apigatewaypatch

package
v0.0.0-...-1eb86f4 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Resolve

func Resolve(prevVersion, nextVersion interface{}, fields ...Field) ([]apigateway.PatchOperation, error)

Resolve resolves differences between two inputs and creates a list of AWS APIGateway patch operations.

Both prevVersion and nextVersion must be structs or pointers to structs, and must have the same type.

The results are returned in the order the fields are defined in the struct.

Types

type Field

type Field struct {
	Name string // Name of the field in the struct. Dot.Path for nested path.
	Path string // Resulting path in PatchOperation.

	// Optional modifier for modifying the patch operations for a given field, if the
	// default resolver is not sufficient. The function is called with the ops
	// for the current field. The modifier is only called if there are
	// operations to apply to the field.
	Modifier func(input []apigateway.PatchOperation) (output []apigateway.PatchOperation)
}

A Field is a field to compare. If the value has changed, a PatchOperation is created.

Jump to

Keyboard shortcuts

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