helpers

package
v0.0.0-...-57273a9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Copyright (c) Walmart Inc.

This source code is licensed under the Apache 2.0 license found in the LICENSE file in the root directory of this source tree.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInterfaceError

func IsInterfaceError(err error) bool

Types

type Change

type Change interface {
	GetPath() []PathElement
	GetOldValue() reflect.Value
	GetNewValue() reflect.Value
	IsAddition() bool
	IsDeletion() bool
	PathString() string
	Equals(Change) bool
	fmt.Stringer
}

type InterfaceError

type InterfaceError struct{}

func (InterfaceError) Error

func (InterfaceError) Error() string

type PatchError

type PatchError struct {
	// contains filtered or unexported fields
}

func NewPatchError

func NewPatchError(format string, args ...interface{}) PatchError

Create a PathError object for capturing internal errors.

func (PatchError) Error

func (err PatchError) Error() string

type PathElement

type PathElement interface {
	GetIndex() int
	GetKey() reflect.Value
	GetName() string
	IsPointer() bool
	Equals(PathElement) bool
	fmt.Stringer
}

func NewFieldElem

func NewFieldElem(index int, name string) PathElement

Create a Struct Field PathElement.

func NewIndexElem

func NewIndexElem(index int) PathElement

Create an Array/Slice Index PathElement.

func NewKeyElem

func NewKeyElem(key interface{}) PathElement

Create a Map Key PathElement.

func NewPtrElem

func NewPtrElem() PathElement

Create a Pointer PathElement.

type SettableChange

type SettableChange interface {
	Change
	SetNewValue(reflect.Value) error
}

func NewValueAddition

func NewValueAddition(path []PathElement, newValue reflect.Value) SettableChange

func NewValueChange

func NewValueChange(path []PathElement, oldValue reflect.Value, newValue reflect.Value) SettableChange

func NewValueDeletion

func NewValueDeletion(path []PathElement, oldValue reflect.Value) SettableChange

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL