fieldutils

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldConflictError

type FieldConflictError struct {
	Field     interface{}
	Owners    []ezkube.ResourceId
	OwnerType ezkube.Object
	Priority  int32
}

func (FieldConflictError) Error

func (e FieldConflictError) Error() string

type FieldOwnership

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

type FieldOwnershipRegistry

type FieldOwnershipRegistry interface {
	// Registers ownership with a given priority for the given field.
	//
	// If an ownership with a higher or equal priority exists for the field,
	// a ConflictError containing the previous owner and its priority are returned.
	//
	// field must be a pointer to the field.
	RegisterFieldOwnership(obj ezkube.Object, field interface{}, owners []ezkube.ResourceId, ownerType ezkube.Object, priority int32) error

	// gets all the ownerships who share an object.
	GetRegisteredOwnerships(obj ezkube.Object) []FieldOwnership
}

an FieldOwnershipRegistry tracks the ownership of individual object fields. this is used to track e.g. which TrafficPolicy Note that the current implementation of the ownership registry is intentionally non-threadsafe. an FieldOwnershipRegistry should only be called within a single threaded context (i.e. in a translation loop)

func NewOwnershipRegistry

func NewOwnershipRegistry() FieldOwnershipRegistry

Jump to

Keyboard shortcuts

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