/
interface.go
66 lines (58 loc) · 1.06 KB
/
interface.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package herbdata
type Server interface {
Start() error
Stop() error
}
type Store interface {
Set([]byte, []byte) error
Get([]byte) ([]byte, error)
Delete([]byte) error
}
type StoreServer interface {
Store
Server
}
type Deleter interface {
Delete([]byte) error
}
type Setter interface {
Set([]byte, []byte) error
}
type Getter interface {
Get([]byte) ([]byte, error)
}
type SetterGetter interface {
Setter
Getter
}
type SetterGetterServer interface {
Setter
Getter
Server
}
type Cache interface {
Get([]byte) ([]byte, error)
SetWithTTL(key []byte, value []byte, ttl int64) error
Delete([]byte) error
}
type FlushableCache interface {
Flush() error
Cache
}
type CacheServer interface {
Cache
Server
}
type SetterDeleter interface {
Set([]byte, []byte) error
Delete([]byte) error
}
type ExpiredSetter interface {
Set([]byte, []byte) error
SetWithExpired(key []byte, value []byte, expired int64) error
}
type ExpiredSetterDeleter interface {
Set([]byte, []byte) error
SetWithExpired(key []byte, value []byte, expired int64) error
Delete([]byte) error
}