Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ErrTerminate is a sentinel error that can be returned from a MatchFunc to detect when to terminate the walk. // When used with the iterator API, users can check for this error and break out of the for loop. ErrTerminate = errors.Error("terminate") )
Variables ¶
This section is empty.
Functions ¶
func SetAtLocation ¶ added in v1.6.0
func SetAtLocation[T any](parent any, l LocationContext[T], value any) error
Types ¶
type LocationContext ¶
type LocationContext[T any] struct { ParentMatchFunc T ParentField string ParentKey *string ParentIndex *int }
LocationContext represents the context of where an element is located within its parent. It uses generics to work with different MatchFunc types from different packages.
type Locations ¶
type Locations[T any] []LocationContext[T]
Locations represents a slice of location contexts that can be converted to a JSON pointer.
func (Locations[T]) ToJSONPointer ¶
func (l Locations[T]) ToJSONPointer() jsonpointer.JSONPointer
ToJSONPointer converts the locations to a JSON pointer.
Click to show internal directories.
Click to hide internal directories.