Define secret store interface

Signed-off-by: Hasan Turken <turkenh@gmail.com>
This commit is contained in:
Hasan Turken 2022-02-08 18:20:47 +03:00
parent 4b082d3585
commit 300dc3127f
No known key found for this signature in database
GPG Key ID: D7AA042F8F8B488E
1 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,35 @@
package secret
import (
"context"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
)
type KeyValues map[string][]byte
type Instance struct {
Name string
Scope string
Owner metav1.OwnerReference
Metadata v1.ConnectionSecretMetadata
}
type KeyValuesReader interface {
ReadKeyValues(ctx context.Context, i Instance) (KeyValues, error)
}
type KeyValuesWriter interface {
WriteKeyValues(ctx context.Context, i Instance, kv KeyValues) error
}
type KeyValuesDeleter interface {
DeleteKeyValues(ctx context.Context, i Instance, kv KeyValues) error
}
type Store interface {
KeyValuesReader
KeyValuesWriter
KeyValuesDeleter
}