-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterface.go
More file actions
39 lines (31 loc) · 879 Bytes
/
interface.go
File metadata and controls
39 lines (31 loc) · 879 Bytes
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
package persistence
type Section interface {
Section(key ...string) Section
SectionKeys() []string
SectionExists(key string) bool
SectionDelete(key string) bool
Keys() []string
Exists(key string) bool
Type(key string) ValueType
Int(key string, defValue ...int64) (int64, bool)
UInt(key string, defValue ...uint64) (uint64, bool)
String(key string, defValue ...string) (string, bool)
Bool(key string, defValue ...bool) (bool, bool)
Float(key string, defValue ...float64) (float64, bool)
Bytes(key string, defValue ...[]byte) ([]byte, bool)
Set(key string, value interface{})
Delete(key string) bool
}
type Syncer interface {
Sync()
}
type ValueType uint8
const (
Int ValueType = 0
UnsignedInt ValueType = 1
String ValueType = 2
Bool ValueType = 3
Float ValueType = 4
Bytes ValueType = 5
None ValueType = 255
)