chore: Define the SecretsStore interface, basically a thin wrapper on top of bbolt.
This commit is contained in:
1 parent
4bd8ca54b6
commit
ccbbfd200c
3 files changed
+38
No files matched your search
@@ -0,0 +1,20 @@
|
||||
package secretsstore
|
||||
|
||||
// bboltStore implements the SecretsStore interface on top of a bbolt bucket.
|
||||
type bboltStore struct {
|
||||
}
|
||||
|
||||
func (s *bboltStore) Get(key Key) ([]byte, error) {
|
||||
// TODO
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (s *bboltStore) Put(key Key, val []byte) error {
|
||||
// TODO
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *bboltStore) Delete(key Key) error {
|
||||
// TODO
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package secretsstore
|
||||
|
||||
type Key string
|
||||
@@ -0,0 +1,15 @@
|
||||
package secretsstore
|
||||
|
||||
type SecretsStore interface {
|
||||
// Get retrieves the value associated with the provided key from the store.
|
||||
Get(key Key) ([]byte, error)
|
||||
// Put stores or replaces the value associated with the provided key.
|
||||
Put(key Key, val []byte) error
|
||||
// Delete removes the key and value from the store, deleting a non-existing key is a no-op.
|
||||
Delete(key Key) error
|
||||
}
|
||||
|
||||
func New(path string) SecretsStore {
|
||||
// TODO: Actually instantiate the struct.
|
||||
return &bboltStore{}
|
||||
}
|
||||
Reference in new issue
Block a user