field

package
v1.12.7 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SpecKeys = []string{"port", "path", "id", "name"}

Functions

func Apply

func Apply(object proto.Message, changes []Change) (proto.Message, error)

Types

type Change

type Change struct {
	FieldPath string
	FieldID   string
	From      Value
	To        Value
	Operation Operation
}

func (Change) String

func (c Change) String() string

func (Change) ToProto

func (c Change) ToProto() *capsule.FieldChange

type Diff

type Diff struct {
	From      any
	To        any
	FromBytes []byte
	ToBytes   []byte
	Report    *dyff.Report
	Changes   []Change
}

func Compare

func Compare(from, to proto.Message, keys ...string) (*Diff, error)

type Operation

type Operation string
const (
	AddedOperation    Operation = "ADDED"
	RemovedOperation  Operation = "REMOVED"
	ModifiedOperation Operation = "MODIFIED"
)

type Type

type Type int
const (
	NullType     Type = iota
	DocumentType Type = iota
	MapType      Type = iota
	ListType     Type = iota
	StringType   Type = iota
	OtherType    Type = iota
)

type Value

type Value struct {
	AsString string
	Type     Type
}

func GetValue

func GetValue(node *yaml.Node) Value

Jump to

Keyboard shortcuts

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