json/model/types.go

20 lines
369 B
Go
Raw Normal View History

2022-11-16 05:11:19 +03:00
package model
type NodeType string
const (
2022-11-21 04:31:56 +03:00
StringType NodeType = "string"
NumberType NodeType = "number"
ObjectType NodeType = "object"
ArrayType NodeType = "array"
BooleanType NodeType = "boolean"
NullType NodeType = "null"
2022-11-16 05:11:19 +03:00
)
2022-11-21 04:31:56 +03:00
type NodeObjectValue map[string]Node
2022-11-16 05:11:19 +03:00
2022-12-04 16:02:03 +03:00
func (n NodeObjectValue) Set(k string, v any) error {
2022-11-16 05:11:19 +03:00
n[k] = NewNode(v)
2022-12-04 16:02:03 +03:00
return nil
2022-11-16 05:11:19 +03:00
}