diff --git a/pkg/connection/fake/mocks.go b/pkg/connection/fake/mocks.go deleted file mode 100644 index 62d55d3..0000000 --- a/pkg/connection/fake/mocks.go +++ /dev/null @@ -1,29 +0,0 @@ -package fake - -import ( - "context" - - "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" - - "github.com/crossplane/crossplane-runtime/pkg/resource" -) - -type SecretStoreFns struct { - ConnectionPublisherFns -} - -// ConnectionPublisherFns is the pluggable struct to produce objects with ConnectionPublisher interface. -type ConnectionPublisherFns struct { - PublishConnectionFn func(ctx context.Context, mg resource.Managed, c managed.ConnectionDetails) error - UnpublishConnectionFn func(ctx context.Context, mg resource.Managed, c managed.ConnectionDetails) error -} - -// PublishConnection details for the supplied Managed resource. -func (fn ConnectionPublisherFns) PublishConnection(ctx context.Context, mg resource.Managed, c managed.ConnectionDetails) error { - return fn.PublishConnectionFn(ctx, mg, c) -} - -// UnpublishConnection details for the supplied Managed resource. -func (fn ConnectionPublisherFns) UnpublishConnection(ctx context.Context, mg resource.Managed, c managed.ConnectionDetails) error { - return fn.UnpublishConnectionFn(ctx, mg, c) -} diff --git a/pkg/connection/secret/fake/store.go b/pkg/connection/secret/fake/store.go new file mode 100644 index 0000000..2c8e100 --- /dev/null +++ b/pkg/connection/secret/fake/store.go @@ -0,0 +1,25 @@ +package fake + +import ( + "context" + + "github.com/crossplane/crossplane-runtime/pkg/connection/secret/store" +) + +type SecretStore struct { + ReadKeyValuesFn func(ctx context.Context, i store.SecretInstance) (store.KeyValues, error) + WriteKeyValuesFn func(ctx context.Context, i store.SecretInstance, kv store.KeyValues) error + DeleteKeyValuesFn func(ctx context.Context, i store.SecretInstance, kv store.KeyValues) error +} + +func (ss *SecretStore) ReadKeyValues(ctx context.Context, i store.SecretInstance) (store.KeyValues, error) { + return ss.ReadKeyValuesFn(ctx, i) +} + +func (ss *SecretStore) WriteKeyValues(ctx context.Context, i store.SecretInstance, kv store.KeyValues) error { + return ss.WriteKeyValuesFn(ctx, i, kv) +} + +func (ss *SecretStore) DeleteKeyValues(ctx context.Context, i store.SecretInstance, kv store.KeyValues) error { + return ss.DeleteKeyValuesFn(ctx, i, kv) +}