Documentation ¶
Index ¶
- type Cursor
- func (c Cursor) Bool(path string) bool
- func (c Cursor) Exists() bool
- func (c Cursor) Float32(path string) float32
- func (c Cursor) Float64(path string) float64
- func (c Cursor) ForEachArray(path string, iterator func(value Cursor) bool)
- func (c Cursor) Get(path string) Cursor
- func (c Cursor) Go(path string) bool
- func (c Cursor) Int32(path string) int32
- func (c Cursor) Int64(path string) int64
- func (c Cursor) IsArray() bool
- func (c Cursor) IsObject() bool
- func (c Cursor) Result() gjson.Result
- func (c Cursor) String(path string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cursor ¶
type Cursor struct {
// contains filtered or unexported fields
}
Cursor is a wrapper for gjson.Result providing easier interface for getting values from a JSON string in some use cases (ie. copying values on different types from JSON to structs). The wrapper may have some performance penalty compared to using directly gjson.Result but on the other hand it allows (domain specific) parsing code to be a bit less verbose.
func (Cursor) ForEachArray ¶
ForEachArray iterates through array on a path location.
func (Cursor) Go ¶
Go moves the cursor to a new path location if such location exists (and returning true). If a new path location does not exits, returns false.
Click to show internal directories.
Click to hide internal directories.