-
Notifications
You must be signed in to change notification settings - Fork 1
/
redux_interfaces.go
32 lines (29 loc) 路 1.18 KB
/
redux_interfaces.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
package kvas
import "io"
type ReadableRedux interface {
MustHave(assets ...string) error
Keys(asset string) []string
HasAsset(asset string) bool
HasKey(asset, key string) bool
HasValue(asset, key, val string) bool
GetAllValues(asset, key string) ([]string, bool)
GetFirstVal(asset, key string) (string, bool)
GetLastVal(asset, key string) (string, bool)
ModTime() (int64, error)
RefreshReader() (ReadableRedux, error)
MatchAsset(asset string, terms []string, scope []string, options ...MatchOption) []string
Match(query map[string][]string, options ...MatchOption) []string
Sort(ids []string, desc bool, sortBy ...string) ([]string, error)
Export(w io.Writer, keys ...string) error
}
type WriteableRedux interface {
ReadableRedux
AddValues(asset, key string, values ...string) error
BatchAddValues(asset string, keyValues map[string][]string) error
ReplaceValues(asset, key string, values ...string) error
BatchReplaceValues(asset string, keyValues map[string][]string) error
CutValues(asset, key string, values ...string) error
CutKeys(asset string, keys ...string) error
BatchCutValues(asset string, keyValues map[string][]string) error
RefreshWriter() (WriteableRedux, error)
}