diff --git a/features/extension/storage.go b/features/extension/storage.go index 4435930ce..85ed90fef 100644 --- a/features/extension/storage.go +++ b/features/extension/storage.go @@ -13,23 +13,3 @@ type PersistentStorageEngine interface { Get(ctx context.Context, key []byte) ([]byte, error) List(ctx context.Context, keyPrefix []byte) ([][]byte, error) } - -type ScopedPersistentStorage interface { - ScopedPersistentStorageEngine() - - Put(ctx context.Context, key []byte, value []byte) error - Get(ctx context.Context, key []byte) ([]byte, error) - List(ctx context.Context, keyPrefix []byte) ([][]byte, error) - - ClearIfCharacteristicMismatch(ctx context.Context, characteristic []byte) error - NarrowScope(ctx context.Context, key []byte) (ScopedPersistentStorage, error) -} - -type ScopedTransientStorage interface { - ScopedTransientStorage() - Put(ctx context.Context, key []byte, value interface{}) error - Get(ctx context.Context, key []byte) (interface{}, error) - List(ctx context.Context, keyPrefix []byte) ([][]byte, error) - Clear(ctx context.Context) - NarrowScope(ctx context.Context, key []byte) (ScopedPersistentStorage, error) -} diff --git a/features/extension/storage/storage.go b/features/extension/storage/storage.go new file mode 100644 index 000000000..a3524a2d4 --- /dev/null +++ b/features/extension/storage/storage.go @@ -0,0 +1,25 @@ +package storage + +import ( + "context" +) + +type ScopedPersistentStorage interface { + ScopedPersistentStorageEngine() + + Put(ctx context.Context, key []byte, value []byte) error + Get(ctx context.Context, key []byte) ([]byte, error) + List(ctx context.Context, keyPrefix []byte) ([][]byte, error) + + ClearIfCharacteristicMismatch(ctx context.Context, characteristic []byte) error + NarrowScope(ctx context.Context, key []byte) (ScopedPersistentStorage, error) +} + +type ScopedTransientStorage interface { + ScopedTransientStorage() + Put(ctx context.Context, key []byte, value interface{}) error + Get(ctx context.Context, key []byte) (interface{}, error) + List(ctx context.Context, keyPrefix []byte) ([][]byte, error) + Clear(ctx context.Context) + NarrowScope(ctx context.Context, key []byte) (ScopedPersistentStorage, error) +}