Skip to content

Commit

Permalink
refactor(syncer): alias to ORM with new spec DS
Browse files Browse the repository at this point in the history
  • Loading branch information
MStreet3 committed Nov 21, 2024
1 parent 694dfe9 commit 4dd15dd
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/services/workflows/syncer/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ type eventHandler struct {
// newEventHandler returns a new eventHandler instance.
func newEventHandler(
lggr logger.Logger,
orm WorkflowSecretsDS,
orm ORM,
gateway FetcherFunc,
workflowStore store.Store,
capRegistry core.CapabilitiesRegistry,
Expand Down
58 changes: 58 additions & 0 deletions core/services/workflows/syncer/mocks/orm.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions core/services/workflows/syncer/orm.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,19 @@ type WorkflowSpecsDS interface {
CreateWorkflowSpec(ctx context.Context, spec *job.WorkflowSpec) (int64, error)
}

type WorkflowRegistryDS = WorkflowSecretsDS
type ORM interface {
WorkflowSecretsDS
WorkflowSpecsDS
}

type WorkflowRegistryDS = ORM

type orm struct {
ds sqlutil.DataSource
lggr logger.Logger
}

var _ WorkflowSecretsDS = (*orm)(nil)
var _ WorkflowRegistryDS = (*orm)(nil)

func NewWorkflowRegistryDS(ds sqlutil.DataSource, lggr logger.Logger) *orm {
return &orm{
Expand Down

0 comments on commit 4dd15dd

Please sign in to comment.