Documentation
¶
Index ¶
- func ApplyPatches(bytes []byte, applyOpt mo.Option[ApplyOptions], ...) mo.Result[[]byte]
- func NewAdd(path string, value any) mo.Option[JSONPatchOperationObject]
- func NewPatches(operations ...mo.Option[JSONPatchOperationObject]) []byte
- func NewRemove(path string) mo.Option[JSONPatchOperationObject]
- func NewReplace(path string, to any) mo.Option[JSONPatchOperationObject]
- type ApplyOptions
- type JSONPatchOperation
- type JSONPatchOperationObject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyPatches ¶
func ApplyPatches(bytes []byte, applyOpt mo.Option[ApplyOptions], patches ...mo.Option[JSONPatchOperationObject]) mo.Result[[]byte]
func NewPatches ¶
func NewPatches(operations ...mo.Option[JSONPatchOperationObject]) []byte
func NewReplace ¶
func NewReplace(path string, to any) mo.Option[JSONPatchOperationObject]
Types ¶
type ApplyOptions ¶
type ApplyOptions jsonpatch.ApplyOptions
type JSONPatchOperation ¶
type JSONPatchOperation string
const ( JSONPatchOperationAdd JSONPatchOperation = "add" JSONPatchOperationRemove JSONPatchOperation = "remove" JSONPatchOperationReplace JSONPatchOperation = "replace" )
type JSONPatchOperationObject ¶
type JSONPatchOperationObject struct { Operation JSONPatchOperation `json:"op"` Path string `json:"path"` Value any `json:"value,omitempty"` }
Click to show internal directories.
Click to hide internal directories.