Documentation ¶
Index ¶
Constants ¶
View Source
const ( PatchReplaceOp = "replace" PatchTestOp = "test" PatchAddOp = "add" PatchRemoveOp = "remove" )
Variables ¶
This section is empty.
Functions ¶
func EscapeJSONPointer ¶
func GeneratePatchPayload ¶
func GeneratePatchPayload(patches ...PatchOperation) ([]byte, error)
Types ¶
type PatchOperation ¶
type PatchOperation struct { Op string `json:"op"` Path string `json:"path"` Value interface{} `json:"value"` }
func UnmarshalPatch ¶
func UnmarshalPatch(patch []byte) ([]PatchOperation, error)
func (*PatchOperation) MarshalJSON ¶ added in v1.3.0
func (p *PatchOperation) MarshalJSON() ([]byte, error)
type PatchOption ¶ added in v1.3.0
type PatchOption func(patches *PatchSet)
func WithAdd ¶ added in v1.3.0
func WithAdd(path string, value interface{}) PatchOption
func WithRemove ¶ added in v1.3.0
func WithRemove(path string) PatchOption
func WithReplace ¶ added in v1.3.0
func WithReplace(path string, value interface{}) PatchOption
func WithTest ¶ added in v1.3.0
func WithTest(path string, value interface{}) PatchOption
type PatchSet ¶ added in v1.3.0
type PatchSet struct {
// contains filtered or unexported fields
}
func New ¶ added in v1.3.0
func New(opts ...PatchOption) *PatchSet
func (*PatchSet) AddOption ¶ added in v1.3.0
func (p *PatchSet) AddOption(opts ...PatchOption)
func (*PatchSet) GeneratePayload ¶ added in v1.3.0
func (*PatchSet) GetPatches ¶ added in v1.4.0
func (p *PatchSet) GetPatches() []PatchOperation
Click to show internal directories.
Click to hide internal directories.