mirror of https://github.com/v2fly/v2ray-core.git
rewrite scoped storage interface
This commit is contained in:
parent
5b7b53c2a8
commit
0bfc2d1cd4
|
@ -9,15 +9,17 @@ type ScopedPersistentStorage interface {
|
||||||
Put(ctx context.Context, key []byte, value []byte) error
|
Put(ctx context.Context, key []byte, value []byte) error
|
||||||
Get(ctx context.Context, key []byte) ([]byte, error)
|
Get(ctx context.Context, key []byte) ([]byte, error)
|
||||||
List(ctx context.Context, keyPrefix []byte) ([][]byte, error)
|
List(ctx context.Context, keyPrefix []byte) ([][]byte, error)
|
||||||
ClearIfCharacteristicMismatch(ctx context.Context, characteristic []byte) error
|
Clear(ctx context.Context)
|
||||||
NarrowScope(ctx context.Context, key []byte) (ScopedPersistentStorage, error)
|
NarrowScope(ctx context.Context, key []byte) (ScopedPersistentStorage, error)
|
||||||
|
DropScope(ctx context.Context, key []byte) error
|
||||||
}
|
}
|
||||||
|
|
||||||
type ScopedTransientStorage interface {
|
type ScopedTransientStorage interface {
|
||||||
ScopedTransientStorage()
|
ScopedTransientStorage()
|
||||||
Put(ctx context.Context, key []byte, value interface{}) error
|
Put(ctx context.Context, key string, value interface{}) error
|
||||||
Get(ctx context.Context, key []byte) (interface{}, error)
|
Get(ctx context.Context, key string) (interface{}, error)
|
||||||
List(ctx context.Context, keyPrefix []byte) ([][]byte, error)
|
List(ctx context.Context, keyPrefix string) ([]string, error)
|
||||||
Clear(ctx context.Context)
|
Clear(ctx context.Context)
|
||||||
NarrowScope(ctx context.Context, key []byte) (ScopedPersistentStorage, error)
|
NarrowScope(ctx context.Context, key string) (ScopedPersistentStorage, error)
|
||||||
|
DropScope(ctx context.Context, key string) error
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue