Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrBadJSONDoc = errors.New("Invalid JSON document")
var ErrBadPatchFormatForPrimitiveList = errors.New("Invalid patch format of primitive list")
var ErrNoListOfLists = errors.New("Lists of lists are not supported")
Functions ¶
func HasConflicts ¶
HasConflicts returns true if the left and right JSON interface objects overlap with different values in any key. All keys are required to be strings. Since patches of the same Type have congruent keys, this is valid for multiple patch types. This method supports JSON merge patch semantics.
func IsConflict ¶
IsConflict returns true if the provided error indicates a conflict between the patch and the current configuration.
func IsPreconditionFailed ¶
IsPreconditionFailed returns true if the provided error indicates a precondition failed.
func ToYAMLOrError ¶
func ToYAMLOrError(v interface{}) string
Types ¶
type ErrConflict ¶
type ErrConflict struct {
// contains filtered or unexported fields
}
func NewErrConflict ¶
func NewErrConflict(patch, current string) ErrConflict
func (ErrConflict) Error ¶
func (err ErrConflict) Error() string
type ErrPreconditionFailed ¶
type ErrPreconditionFailed struct {
// contains filtered or unexported fields
}
func NewErrPreconditionFailed ¶
func NewErrPreconditionFailed(target map[string]interface{}) ErrPreconditionFailed
func (ErrPreconditionFailed) Error ¶
func (err ErrPreconditionFailed) Error() string
type PreconditionFunc ¶
type PreconditionFunc func(interface{}) bool
PreconditionFunc asserts that an incompatible change is not present within a patch.
func RequireKeyUnchanged ¶
func RequireKeyUnchanged(key string) PreconditionFunc
RequireKeyUnchanged returns a precondition function that fails if the provided key is present in the patch (indicating that its value has changed).
func RequireMetadataKeyUnchanged ¶
func RequireMetadataKeyUnchanged(key string) PreconditionFunc
RequireMetadataKeyUnchanged creates a precondition function that fails if the metadata.key is present in the patch (indicating its value has changed).