jsonpath

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPath      = errors.New("invalid path")
	ErrInvalidKey       = errors.New("key not found")
	ErrInvalidEncoding  = errors.New("invalid encoding")
	ErrInvalidReference = errors.New("invalid reference")
)

Functions

func DecodeEntryKey

func DecodeEntryKey(name string) (string, error)

func EncodeEntryKey

func EncodeEntryKey(name string) string

func GetRefObject

func GetRefObject(path []string, v interface{}) (map[string]interface{}, error)

func ParseRefStr

func ParseRefStr(docName string, strRef string) (string, string, error)

Types

type HttpClient

type HttpClient interface {
	Get(url string) (resp *http.Response, err error)
}

type Ref

type Ref struct {
	// contains filtered or unexported fields
}

func NewRef

func NewRef(ref interface{}) (Ref, error)

func (Ref) NewChild

func (r Ref) NewChild(name interface{}) (Ref, error)

func (Ref) Path

func (r Ref) Path() []string

func (Ref) String

func (r Ref) String() string

func (Ref) URI

func (r Ref) URI() string

type RefLoader

type RefLoader func(string) (map[string]interface{}, error)

func NewRefLoader

func NewRefLoader(client HttpClient) RefLoader

func (RefLoader) Load

func (l RefLoader) Load(documentRef string) (map[string]interface{}, error)

Jump to

Keyboard shortcuts

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