Skip to content

Commit 07a9af1

Browse files
authored
Merge pull request #250 from cschleiden/module-reorg-2
Improve code organization /2
2 parents 5349aae + d1c1935 commit 07a9af1

File tree

112 files changed

+409
-487
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+409
-487
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ Create a `Client` instance then then call `CancelWorkflow` to cancel a workflow.
268268
Sub-workflows will be canceled if their parent workflow is canceled.
269269

270270
```go
271-
var c client.Client
271+
var c *client.Client
272272
err = c.CancelWorkflowInstance(context.Background(), workflowInstance)
273273
if err != nil {
274274
panic("could not cancel workflow")

activitytester/activitytester.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import (
88
"github.com/cschleiden/go-workflows/internal/activity"
99
)
1010

11+
// WithActivityTestState returns a context with an activity state attached that can be used for unit testing
12+
// activities.
1113
func WithActivityTestState(ctx context.Context, activityID, instanceID string, logger *slog.Logger) context.Context {
1214
if logger == nil {
1315
logger = slog.Default()

backend/backend.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ import (
55
"errors"
66
"log/slog"
77

8+
"github.com/cschleiden/go-workflows/backend/converter"
89
"github.com/cschleiden/go-workflows/backend/history"
9-
"github.com/cschleiden/go-workflows/contextpropagation"
10-
"github.com/cschleiden/go-workflows/converter"
10+
"github.com/cschleiden/go-workflows/backend/metrics"
1111
"github.com/cschleiden/go-workflows/core"
12-
"github.com/cschleiden/go-workflows/metrics"
1312
"github.com/cschleiden/go-workflows/workflow"
1413
"go.opentelemetry.io/otel/trace"
1514
)
@@ -83,5 +82,5 @@ type Backend interface {
8382
Converter() converter.Converter
8483

8584
// ContextPropagators returns the configured context propagators for the backend
86-
ContextPropagators() []contextpropagation.ContextPropagator
85+
ContextPropagators() []workflow.ContextPropagator
8786
}

converter/converter.go renamed to backend/converter/converter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package converter
22

33
import (
4-
"github.com/cschleiden/go-workflows/internal/payload"
4+
"github.com/cschleiden/go-workflows/backend/payload"
55
)
66

77
type Converter interface {

converter/json.go renamed to backend/converter/json.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package converter
33
import (
44
"encoding/json"
55

6-
"github.com/cschleiden/go-workflows/internal/payload"
6+
"github.com/cschleiden/go-workflows/backend/payload"
77
)
88

99
type jsonConverter struct{}

backend/history/activity_completed.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package history
22

3-
import "github.com/cschleiden/go-workflows/internal/payload"
3+
import "github.com/cschleiden/go-workflows/backend/payload"
44

55
type ActivityCompletedAttributes struct {
66
Result payload.Payload `json:"result,omitempty"`

backend/history/activity_scheduled.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package history
22

33
import (
44
"github.com/cschleiden/go-workflows/backend/metadata"
5-
"github.com/cschleiden/go-workflows/internal/payload"
5+
"github.com/cschleiden/go-workflows/backend/payload"
66
)
77

88
type ActivityScheduledAttributes struct {

backend/history/side_effect_result.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package history
22

3-
import "github.com/cschleiden/go-workflows/internal/payload"
3+
import "github.com/cschleiden/go-workflows/backend/payload"
44

55
type SideEffectResultAttributes struct {
66
Result payload.Payload `json:"result,omitempty"`

backend/history/signal_received.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package history
22

3-
import "github.com/cschleiden/go-workflows/internal/payload"
3+
import "github.com/cschleiden/go-workflows/backend/payload"
44

55
type SignalReceivedAttributes struct {
66
Name string `json:"name,omitempty"`

backend/history/subworkflow_completed.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package history
22

3-
import "github.com/cschleiden/go-workflows/internal/payload"
3+
import "github.com/cschleiden/go-workflows/backend/payload"
44

55
type SubWorkflowCompletedAttributes struct {
66
Result payload.Payload `json:"result,omitempty"`

0 commit comments

Comments
 (0)