-
Notifications
You must be signed in to change notification settings - Fork 0
/
interfaces.go
91 lines (70 loc) · 1.8 KB
/
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
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
80
81
82
83
84
85
86
87
88
89
90
91
package schema
import "github.com/benpate/rosetta/list"
// Nullable interface wraps the IsNull method, that helps an object
// to identify if it contains a null value or not. This mirrors
// the null.Nullable interface here, for convenience.
type Nullable interface {
IsNull() bool
}
type Enumerator interface {
Enumerate() []string
}
/******************************************
* Getter Interfaces
******************************************/
type BoolGetter interface {
GetBoolOK(string) (bool, bool)
}
type FloatGetter interface {
GetFloatOK(string) (float64, bool)
}
type IntGetter interface {
GetIntOK(string) (int, bool)
}
type Int64Getter interface {
GetInt64OK(string) (int64, bool)
}
type StringGetter interface {
GetStringOK(string) (string, bool)
}
/******************************************
* Special-Case Getter Interfaces
******************************************/
// PointerGetter allows objects to return a pointer to a child object
type PointerGetter interface {
GetPointer(string) (any, bool)
}
// LengthGetter allows arrays to report their total length
type LengthGetter interface {
Length() int
}
/******************************************
* Setter Interfaces
******************************************/
type BoolSetter interface {
SetBool(string, bool) bool
}
type FloatSetter interface {
SetFloat(string, float64) bool
}
type IntSetter interface {
SetInt(string, int) bool
}
type Int64Setter interface {
SetInt64(string, int64) bool
}
type ObjectSetter interface {
SetObject(Element, list.List, any) error
}
type StringSetter interface {
SetString(string, string) bool
}
type ValueSetter interface {
SetValue(any) error
}
/******************************************
* Remover Interface
******************************************/
type Remover interface {
Remove(string) bool
}