Skip to content

Commit 67f05d6

Browse files
committed
types can now be private
1 parent 736c244 commit 67f05d6

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

dbos/system_database.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ type systemDatabase interface {
5050

5151
// Communication (special steps)
5252
send(ctx context.Context, input WorkflowSendInput) error
53-
recv(ctx context.Context, input RecvInput) (any, error)
53+
recv(ctx context.Context, input recvInput) (any, error)
5454
setEvent(ctx context.Context, input WorkflowSetEventInput) error
55-
getEvent(ctx context.Context, input GetEventInput) (any, error)
55+
getEvent(ctx context.Context, input getEventInput) (any, error)
5656

5757
// Timers (special steps)
5858
sleep(ctx context.Context, duration time.Duration) (time.Duration, error)
@@ -1510,7 +1510,7 @@ func (s *sysDB) send(ctx context.Context, input WorkflowSendInput) error {
15101510
}
15111511

15121512
// Recv is a special type of step that receives a message destined for a given workflow
1513-
func (s *sysDB) recv(ctx context.Context, input RecvInput) (any, error) {
1513+
func (s *sysDB) recv(ctx context.Context, input recvInput) (any, error) {
15141514
functionName := "DBOS.recv"
15151515

15161516
// Get workflow state from context
@@ -1733,7 +1733,7 @@ func (s *sysDB) setEvent(ctx context.Context, input WorkflowSetEventInput) error
17331733
return nil
17341734
}
17351735

1736-
func (s *sysDB) getEvent(ctx context.Context, input GetEventInput) (any, error) {
1736+
func (s *sysDB) getEvent(ctx context.Context, input getEventInput) (any, error) {
17371737
functionName := "DBOS.getEvent"
17381738

17391739
// Get workflow state from context (optional for GetEvent as we can get an event from outside a workflow)

dbos/workflow.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,6 @@ func (c *dbosContext) RunAsStep(_ DBOSContext, fn StepFunc, opts ...StepOption)
10831083
/******* WORKFLOW COMMUNICATIONS ********/
10841084
/****************************************/
10851085

1086-
10871086
func (c *dbosContext) Send(_ DBOSContext, destinationID string, message any, topic string) error {
10881087
return c.systemDB.send(c, WorkflowSendInput{
10891088
DestinationID: destinationID,
@@ -1110,14 +1109,14 @@ func Send[P any](ctx DBOSContext, destinationID string, message P, topic string)
11101109
return ctx.Send(ctx, destinationID, message, topic)
11111110
}
11121111

1113-
// RecvInput defines the parameters for receiving messages sent to this workflow.
1114-
type RecvInput struct {
1112+
// recvInput defines the parameters for receiving messages sent to this workflow.
1113+
type recvInput struct {
11151114
Topic string // Topic to listen for (empty string receives from default topic)
11161115
Timeout time.Duration // Maximum time to wait for a message
11171116
}
11181117

11191118
func (c *dbosContext) Recv(_ DBOSContext, topic string, timeout time.Duration) (any, error) {
1120-
input := RecvInput{
1119+
input := recvInput{
11211120
Topic: topic,
11221121
Timeout: timeout,
11231122
}
@@ -1185,15 +1184,15 @@ func SetEvent[P any](ctx DBOSContext, key string, message P) error {
11851184
return ctx.SetEvent(ctx, key, message)
11861185
}
11871186

1188-
// GetEventInput defines the parameters for retrieving an event from a workflow.
1189-
type GetEventInput struct {
1187+
// getEventInput defines the parameters for retrieving an event from a workflow.
1188+
type getEventInput struct {
11901189
TargetWorkflowID string // Workflow ID to get the event from
11911190
Key string // Event key to retrieve
11921191
Timeout time.Duration // Maximum time to wait for the event to be set
11931192
}
11941193

11951194
func (c *dbosContext) GetEvent(_ DBOSContext, targetWorkflowID string, key string, timeout time.Duration) (any, error) {
1196-
input := GetEventInput{
1195+
input := getEventInput{
11971196
TargetWorkflowID: targetWorkflowID,
11981197
Key: key,
11991198
Timeout: timeout,

0 commit comments

Comments
 (0)