1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 10:08:15 -05:00
v2fly/features/extension/storage/storage.go
2021-09-05 16:37:27 +01:00

26 lines
814 B
Go

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)
}