You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tson/gui/type.go

51 lines
646 B
Go

package gui
type JSONType int
const (
Root JSONType = iota + 1
Object
Array
Key
Value
)
var jsonTypeMap = map[JSONType]string{
Object: "object",
Array: "array",
Key: "key",
Value: "value",
}
func (t JSONType) String() string {
return jsonTypeMap[t]
}
type ValueType int
const (
Int ValueType = iota + 1
String
Float
Boolean
Null
)
var valueTypeMap = map[ValueType]string{
Int: "int",
String: "string",
Float: "float",
Boolean: "boolean",
Null: "null",
}
func (v ValueType) String() string {
return valueTypeMap[v]
}
type Reference struct {
ID string
JSONType JSONType
ValueType ValueType
}