jsonpointer

package
v1.12.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pointer

type Pointer []string

Pointer is a JSON pointer that can be retrieved as either as a RFC6901 string or as a JMESPath formatted string.

func New

func New() Pointer

New will return an empty Pointer.

func Parse

func Parse(s string) Pointer

Parse will parse the string as a JSON pointer according to RFC 6901.

func ParsePath

func ParsePath(rawPath string) Pointer

ParsePath will parse the raw path and return it in the form of a Pointer.

func (Pointer) Append

func (p Pointer) Append(s ...string) Pointer

Append will return a Pointer with the strings appended.

func (Pointer) AppendPath

func (p Pointer) AppendPath(s string) Pointer

AppendPath will parse the string as a JSON pointer and return a new pointer.

func (Pointer) JMESPath

func (p Pointer) JMESPath() string

JMESPath will return the Pointer in the form of a JMESPath string.

func (Pointer) Prepend

func (p Pointer) Prepend(s ...string) Pointer

Prepend will return a Pointer prefixed with the specified strings.

func (Pointer) SkipN

func (p Pointer) SkipN(n int) Pointer

SkipN will return a new Pointer where the first N element are stripped.

func (Pointer) SkipPast

func (p Pointer) SkipPast(s string) Pointer

SkipPast will return a new Pointer where every element upto and including the specified string has been stripped off.

func (Pointer) String

func (p Pointer) String() string

String will return the pointer as a string (RFC6901).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL