Documentation
¶
Index ¶
- Variables
- func Get(ptr string, value any) (any, error)
- type Pointer
- func (p Pointer) AppendText(buf []byte) ([]byte, error)
- func (p Pointer) Equal(o Pointer) bool
- func (p Pointer) Get(value any) (any, error)
- func (p Pointer) IsZero() bool
- func (p Pointer) MarshalText() ([]byte, error)
- func (p Pointer) NumTokens() int
- func (p Pointer) String() string
- func (p Pointer) Token(i int) string
- func (p Pointer) Tokens() []string
- func (p Pointer) Trim(count int) Pointer
- func (p *Pointer) UnmarshalText(data []byte) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Pointer ¶
type Pointer struct {
// contains filtered or unexported fields
}
Pointer represents a parsed JSON pointer. Parsing a JSON pointer allows it to be evaluated multiple times more efficiently.
func MustParse ¶
MustParse is like Parse but panics if the provided JSON pointer cannot be parsed, instead of returning an error.
func (Pointer) AppendText ¶ added in v0.6.0
AppendText implements the encoding.TextAppender interface.
func (Pointer) Equal ¶ added in v0.3.0
Equal compares two Pointers and reports whether they are equal.
func (Pointer) Get ¶
Get resolves the JSON pointer parsed into p against value and returns the result.
func (Pointer) IsZero ¶ added in v0.5.0
IsZero reports whether the Pointer is the zero value. A zero Pointer value resolves against the root of a value.
func (Pointer) MarshalText ¶ added in v0.2.0
MarshalText implements the encoding.TextMarshaler interface.
func (Pointer) NumTokens ¶ added in v0.7.0
NumTokens returns the number of reference tokens in the Pointer value.
func (Pointer) String ¶ added in v0.2.0
String returns a string representation of the Pointer value.
func (Pointer) Token ¶ added in v0.7.0
Token returns the reference token at the index i. Token returns an empty string if the requested index doesn't exist.
func (Pointer) Trim ¶ added in v0.7.0
Trim removes the first count tokens from the Pointer value and returns the result.
func (*Pointer) UnmarshalText ¶ added in v0.2.0
UnmarshalText implements the encoding.TextUnmarshaler interface.