Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: replace inmemoryprovider with inlineprovider #1348

Merged
merged 3 commits into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions common/configuration/in_memory_provider.go

This file was deleted.

4 changes: 3 additions & 1 deletion go-runtime/modulecontext/from_proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ func FromProto(ctx context.Context, response *ftlv1.ModuleContextResponse) (*Mod
}

func newInMemoryConfigManager[R cf.Role](ctx context.Context, config map[string][]byte) (*cf.Manager[R], error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be renamed?

provider := cf.NewInMemoryProvider[R]()
provider := cf.InlineProvider[R]{
Inline: true,
}
refs := map[cf.Ref]*url.URL{}
for name, data := range config {
ref := cf.Ref{Name: name}
Expand Down
8 changes: 6 additions & 2 deletions go-runtime/modulecontext/module_context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ func TestConfigPriority(t *testing.T) {

moduleName := "test"

cp := cf.NewInMemoryProvider[cf.Configuration]()
cp := cf.InlineProvider[cf.Configuration]{
Inline: true,
}
cr := cf.NewInMemoryResolver[cf.Configuration]()
cm, err := cf.New(ctx, cr, []cf.Provider[cf.Configuration]{cp})
assert.NoError(t, err)
ctx = cf.ContextWithConfig(ctx, cm)

sp := cf.NewInMemoryProvider[cf.Secrets]()
sp := cf.InlineProvider[cf.Secrets]{
Inline: true,
}
sr := cf.NewInMemoryResolver[cf.Secrets]()
sm, err := cf.New(ctx, sr, []cf.Provider[cf.Secrets]{sp})
assert.NoError(t, err)
Expand Down