Documentation
¶
Index ¶
- Variables
- func ApplyJsonPatch[T any](b []byte, encodeFn func(T) ([]byte, error)) (func(T) ([]byte, error), error)
- func ApplyJsonPatchFromPatch[T any](encodeFn func(T) ([]byte, error), patches ...Patch) (func(T) ([]byte, error), error)
- func EqualJsonPatchFromPatch[T any](encodeFn func(T) ([]byte, error), paths []string, values []interface{}) (func(T) error, error)
- type Patch
- type PatchOp
- type Patches
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NilPathErr = errors.New("path is nil") NilFromErr = errors.New("from is nil") )
View Source
var ( DefaultJsonPatchOpt = &jsonpatch.ApplyOptions{ SupportNegativeIndices: jsonpatch.SupportNegativeIndices, AccumulatedCopySizeLimit: jsonpatch.AccumulatedCopySizeLimit, AllowMissingPathOnRemove: true, EnsurePathExistsOnAdd: true, } EmptyPathOrValueErr = errors.New("paths and values must not be empty") PathValueLengthErr = errors.New("paths and values must have the same length") )
Functions ¶
func ApplyJsonPatch ¶
func ApplyJsonPatchFromPatch ¶
Types ¶
type Patch ¶
type Patch struct {
Op PatchOp `json:"op,omitempty" yaml:"op,omitempty"`
Path *string `json:"path,omitempty" yaml:"path,omitempty"`
From *string `json:"from,omitempty" yaml:"from,omitempty"`
Value interface{} `json:"value,omitempty" yaml:"value,omitempty"`
}
func (*Patch) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.