jsonpointer

package
v0.48.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package jsonpointer contains RFC 6901 JSON Pointer implementation.

Index

Constants

View Source
const DefaultDepthLimit = 1000

DefaultDepthLimit is default depth limit for ResolveCtx.

Variables

This section is empty.

Functions

func Resolve

func Resolve(ptr string, node *yaml.Node) (*yaml.Node, error)

Resolve takes given pointer and returns byte slice of requested value if any. If value not found, returns NotFoundError.

Types

type NotFoundError

type NotFoundError struct {
	Pointer string
}

NotFoundError reports that requested value is not found.

func (*NotFoundError) Error

func (n *NotFoundError) Error() string

Error implements error.

type RefKey added in v0.48.0

type RefKey struct {
	Loc string
	Ref string
}

RefKey is JSON reference key.

func (*RefKey) FromURL added in v0.48.0

func (r *RefKey) FromURL(u *url.URL)

FromURL sets RefKey from URL.

type ResolveCtx added in v0.48.0

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

ResolveCtx is JSON pointer resolve context.

func DefaultCtx added in v0.48.0

func DefaultCtx() *ResolveCtx

DefaultCtx creates new ResolveCtx with default depth limit.

func NewResolveCtx added in v0.48.0

func NewResolveCtx(depthLimit int) *ResolveCtx

NewResolveCtx creates new ResolveCtx.

func (*ResolveCtx) Add added in v0.48.0

func (r *ResolveCtx) Add(ref string) (key RefKey, _ error)

Add adds reference to context and returns key.

func (*ResolveCtx) Delete added in v0.48.0

func (r *ResolveCtx) Delete(key RefKey)

Delete removes reference from context.

func (*ResolveCtx) LastLoc added in v0.48.0

func (r *ResolveCtx) LastLoc() string

LastLoc returns last location from stack.

Jump to

Keyboard shortcuts

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