2019-11-01 07:41:49 +00:00
|
|
|
package gui
|
|
|
|
|
2019-11-01 10:52:50 +00:00
|
|
|
type JSONType int
|
2019-11-01 07:41:49 +00:00
|
|
|
|
|
|
|
const (
|
2019-11-01 10:52:50 +00:00
|
|
|
Root JSONType = iota + 1
|
2019-11-01 07:41:49 +00:00
|
|
|
Object
|
|
|
|
Array
|
|
|
|
Key
|
|
|
|
Value
|
|
|
|
)
|
|
|
|
|
2019-11-01 10:52:50 +00:00
|
|
|
var jsonTypeMap = map[JSONType]string{
|
|
|
|
Object: "object",
|
|
|
|
Array: "array",
|
|
|
|
Key: "key",
|
|
|
|
Value: "value",
|
2019-11-01 07:41:49 +00:00
|
|
|
}
|
|
|
|
|
2019-11-01 10:52:50 +00:00
|
|
|
func (t JSONType) String() string {
|
|
|
|
return jsonTypeMap[t]
|
|
|
|
}
|
|
|
|
|
|
|
|
type ValueType int
|
|
|
|
|
|
|
|
const (
|
|
|
|
Int ValueType = iota + 1
|
|
|
|
String
|
|
|
|
Float
|
|
|
|
Boolean
|
2019-11-01 17:23:56 +00:00
|
|
|
Null
|
2019-11-01 10:52:50 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var valueTypeMap = map[ValueType]string{
|
|
|
|
Int: "int",
|
|
|
|
String: "string",
|
|
|
|
Float: "float",
|
|
|
|
Boolean: "boolean",
|
2019-11-01 17:23:56 +00:00
|
|
|
Null: "null",
|
2019-11-01 10:52:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v ValueType) String() string {
|
|
|
|
return valueTypeMap[v]
|
|
|
|
}
|
|
|
|
|
|
|
|
type Reference struct {
|
2019-11-04 14:33:48 +00:00
|
|
|
ID string
|
2019-11-01 10:52:50 +00:00
|
|
|
JSONType JSONType
|
|
|
|
ValueType ValueType
|
2019-11-01 07:41:49 +00:00
|
|
|
}
|