Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // SupportNegativeIndices decides whether to support non-standard practice of // allowing negative indices to mean indices starting at the end of an array. // Default to true. SupportNegativeIndices = true // AccumulatedCopySizeLimit limits the total size increase in bytes caused by // "copy" operations in a patch. AccumulatedCopySizeLimit = int64(0) )
Functions ¶
Types ¶
type AccumulatedCopySizeError ¶
type AccumulatedCopySizeError struct {
// contains filtered or unexported fields
}
AccumulatedCopySizeError is an error type returned when the accumulated size increase caused by copy operations in a patch operation has exceeded the limit.
func NewAccumulatedCopySizeError ¶
func NewAccumulatedCopySizeError(l, a int64) *AccumulatedCopySizeError
NewAccumulatedCopySizeError returns an AccumulatedCopySizeError.
func (*AccumulatedCopySizeError) Error ¶
func (a *AccumulatedCopySizeError) Error() string
Error implements the error interface.
type ArraySizeError ¶
type ArraySizeError struct {
// contains filtered or unexported fields
}
ArraySizeError is an error type returned when the array size has exceeded the limit.
func NewArraySizeError ¶
func NewArraySizeError(l, s int) *ArraySizeError
NewArraySizeError returns an ArraySizeError.
func (*ArraySizeError) Error ¶
func (a *ArraySizeError) Error() string
Error implements the error interface.
type Operation ¶
type Operation struct {
Operation string `json:"op"`
Path string `json:"path"`
Value interface{} `json:"value,omitempty"`
}
Operation operation struct
func CreatePatch ¶
CreatePatch creates a patch as specified in http://jsonpatch.com/
'a' is original, 'b' is the modified document. Both are to be given as json encoded content. The function will return an array of Operations
An error will be returned if any of the two documents are invalid.
func (*Operation) MarshalJSON ¶
MarshalJSON for patch operations