-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.go
More file actions
69 lines (62 loc) · 1.01 KB
/
types.go
File metadata and controls
69 lines (62 loc) · 1.01 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
package bogo
type Type byte
// Type constants
const (
maxStorageByteLength = 5
// Version helps determine which encoders/decoders to use
Version byte = 0x00 // version 0
)
const (
TypeNull = iota
TypeBoolTrue
TypeBoolFalse
TypeString
TypeByte
TypeInt
TypeUint
TypeFloat
TypeBlob
TypeTimestamp
TypeUntypedList
TypeTypedList
TypeObject
)
func (t Type) String() string {
switch t {
case TypeNull:
return "<null>"
case TypeBoolTrue:
return "<bool:true>"
case TypeBoolFalse:
return "<bool:false>"
case TypeString:
return "<string>"
case TypeUntypedList:
return "<list>"
case TypeTypedList:
return "<typed_list>"
case TypeObject:
return "<object>"
case TypeByte:
return "<byte>"
case TypeInt:
return "<int>"
case TypeUint:
return "<uint>"
case TypeFloat:
return "<float>"
case TypeBlob:
return "<blob>"
case TypeTimestamp:
return "<timestamp>"
}
return "<unknown>"
}
type TypeNumber interface {
int64 | float64
}
type FieldInfo struct {
Type Type
Key []byte
Value any
}