Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array struct {
Pos lexer.Position
Items []*Value `parser:"'[' @@ (',' @@)* ']'" json:"items,omitempty"`
}
func (*Array) MarshalJSON ¶
type IndexPath ¶
func NewIndexPath ¶
func NewIndexPath[I StringOrIntLike](index I) *IndexPath
type JArray ¶
type JNode ¶
type JNode interface {
IsJNode()
}
JNode is Node with additional information added. The result of json.Marshal is more organized than Node.
type JObject ¶
type JPair ¶
type JValue ¶
type JValue struct {
Path Path `json:"path"`
Pos *JPos `json:"pos"`
Object *JObject `json:"object,omitempty"`
Array *JArray `json:"array,omitempty"`
String *string `json:"string,omitempty"`
Number *string `json:"number,omitempty"`
True *string `json:"true,omitempty"`
False *string `json:"false,omitempty"`
Null *string `json:"null,omitempty"`
}
type Object ¶
type Object struct {
Pos lexer.Position
Pairs []*Pair `parser:"'{' @@ (',' @@)* '}'" json:"pairs,omitempty"`
}
func (*Object) MarshalJSON ¶
type Pair ¶
type Pair struct {
Pos lexer.Position
Key string `parser:"@String ':'" json:"key,omitempty"`
Value *Value `parser:"@@" json:"value,omitempty"`
}
func (*Pair) MarshalJSON ¶
type Path ¶
type Path []PathElement
func NewPath ¶
func NewPath(elems ...PathElement) Path
func (Path) Add ¶
func (p Path) Add(elem PathElement) Path
func (Path) MarshalJSON ¶
func (Path) WithoutLast ¶
type PathElement ¶
type PathElement interface {
AsPath() string
}
type SimplePath ¶
type SimplePath string
func NewSimplePath ¶
func NewSimplePath[T StringLike](s T) SimplePath
func (SimplePath) AsPath ¶
func (p SimplePath) AsPath() string
type StringLike ¶
type StringLike interface {
~string
}
type StringOrIntLike ¶
type StringOrIntLike interface {
StringLike | IntLike
}
type Value ¶
type Value struct {
Pos lexer.Position
Object *Object `parser:"@@ |" json:"object,omitempty"`
Array *Array `parser:"@@ |" json:"array,omitempty"`
String *string `parser:"@String |" json:"string,omitempty"`
Number *string `parser:"@Number |" json:"number,omitempty"`
True *string `parser:"@True |" json:"true,omitempty"`
False *string `parser:"@False |" json:"false,omitempty"`
Null *string `parser:"@Null" json:"null,omitempty"`
}
func (*Value) MarshalJSON ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.