feat(structure): update interface view
This commit is contained in:
parent
a9dbb5169c
commit
d42b01ff77
|
@ -14,3 +14,40 @@ const (
|
|||
DynamicFloat
|
||||
DynamicString
|
||||
)
|
||||
|
||||
type KeyBaseInterface interface {
|
||||
SizeByte() int64
|
||||
|
||||
// RollBack TODO 事务相关, V2 实现
|
||||
RollBack() error
|
||||
// Begin 事务相关, V2 实现
|
||||
Begin() error
|
||||
// Comment 事务相关, V2 实现
|
||||
Comment() error
|
||||
|
||||
Encode() ([]byte, error)
|
||||
}
|
||||
|
||||
type StringXInterface interface {
|
||||
KeyBaseInterface
|
||||
Set(string) (string, UpdateLength)
|
||||
Get() string
|
||||
Add(int32) (string, error)
|
||||
Reduce(int32) (string, error)
|
||||
Setbit(int32, bool) UpdateLength
|
||||
Getbit(int32) (bool, error)
|
||||
Getrange(start, end int32) (string, error)
|
||||
GetLength() int
|
||||
}
|
||||
|
||||
type ListXInterface interface {
|
||||
KeyBaseInterface
|
||||
LPush(...string) UpdateLength
|
||||
RPush(...string) UpdateLength
|
||||
LPop(int) ([]string, UpdateLength)
|
||||
RPop(int) ([]string, UpdateLength)
|
||||
Index(int) (string, error)
|
||||
Insert(int, bool, ...string) (UpdateLength, error)
|
||||
Length() int
|
||||
Slice(start, end int) (UpdateLength, error) // 切片, O(n)复杂度
|
||||
}
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
package structure
|
||||
|
||||
type KeyBaseInterface interface {
|
||||
SizeByte() int64
|
||||
|
||||
// RollBack TODO 事务相关, V2 实现
|
||||
RollBack() error
|
||||
// Begin 事务相关, V2 实现
|
||||
Begin() error
|
||||
// Comment 事务相关, V2 实现
|
||||
Comment() error
|
||||
|
||||
Encode() ([]byte, error)
|
||||
}
|
||||
|
||||
type StringXInterface interface {
|
||||
KeyBaseInterface
|
||||
Set(string) (string, UpdateLength)
|
||||
Get() string
|
||||
Add(int32) (string, error)
|
||||
Reduce(int32) (string, error)
|
||||
Setbit(int32, bool) UpdateLength
|
||||
Getbit(int32) (bool, error)
|
||||
Getrange(start, end int32) (string, error)
|
||||
GetLength() int
|
||||
}
|
||||
|
||||
type ListXInterface interface {
|
||||
KeyBaseInterface
|
||||
LPush(...string) UpdateLength
|
||||
RPush(...string) UpdateLength
|
||||
LPop(int) ([]string, UpdateLength)
|
||||
RPop(int) ([]string, UpdateLength)
|
||||
Index(int) (string, error)
|
||||
Insert(int, bool, ...string) (UpdateLength, error)
|
||||
Length() int
|
||||
Slice(start, end int) (UpdateLength, error) // 切片, O(n)复杂度
|
||||
}
|
Loading…
Reference in New Issue