-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinterface.go
More file actions
79 lines (65 loc) · 2.23 KB
/
Copy pathinterface.go
File metadata and controls
79 lines (65 loc) · 2.23 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
* Copyright (c) 2023-present unTill Pro, Ltd.
* @author Michael Saigachenko
*/
package extensions
var KeyBuilder func(storage, entity string) (b TKeyBuilder) = keyBuilderImpl
// QueryValue queries value. When not exists it returns exists=false and value=nil.
var QueryValue func(key TKeyBuilder) (exists bool, value TValue) = queryValueImpl
// MustGetValue gets value. Panics when value is not exist
var MustGetValue func(key TKeyBuilder) TValue = mustGetValueImpl
// ReadValues reads using partial key and returns values in callback.
//
// Important: key and value are not kept after callback!
var ReadValues func(key TKeyBuilder, callback func(key TKey, value TValue)) = readValuesImpl
// UpdateValue creates intent to update a value
var UpdateValue func(key TKeyBuilder, existingValue TValue) TIntent = updateValueImpl
// NewValue creates intent for new value
var NewValue func(key TKeyBuilder) TIntent = newValueImpl
type IKey interface {
AsString(name string) string
AsInt32(name string) int32
AsInt64(name string) int64
AsFloat32(name string) float32
AsFloat64(name string) float64
AsBytes(name string) []byte
AsQName(name string) QName
AsBool(name string) bool
}
type IValue interface {
Length() uint32
AsString(name string) string
AsBytes(name string) []byte
AsInt32(name string) int32
AsInt64(name string) int64
AsFloat32(name string) float32
AsFloat64(name string) float64
AsQName(name string) QName
AsBool(name string) bool
AsValue(name string) IValue // throws panic if field is not an object or array
GetAsString(index int) string
GetAsBytes(index int) []byte
GetAsInt32(index int) int32
GetAsInt64(index int) int64
GetAsFloat32(index int) float32
GetAsFloat64(index int) float64
GetAsQName(index int) QName
GetAsBool(index int) bool
GetAsValue(index int) IValue // throws panic if field is not an object or array
}
type IRowWriter interface {
PutInt32(name string, value int32)
PutInt64(name string, value int64)
PutFloat32(name string, value float32)
PutFloat64(name string, value float64)
PutString(name string, value string)
PutBytes(name string, value []byte)
PutQName(name string, value QName)
PutBool(name string, value bool)
}
type IKeyBuilder interface {
IRowWriter
}
type IIntent interface {
IRowWriter
}