state

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2019 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pack

func Pack(v interface{}, state *State) error

Pack parses v and stores the state the value to the state.

func ResourceKey

func ResourceKey(gvk schema.GroupVersionKind) string

func Unpack

func Unpack(state *State, v interface{}) error

Unpack parses the state and stores the value pointed to by v.

Types

type Event

type Event struct {
	Type    string `json:"type"`
	Reason  string `json:"reason"`
	Message string `json:"message"`
}

Event represents an event of Kubernetes.

func (*Event) Validate

func (e *Event) Validate() error

Validate validates the content of event.

type State

type State struct {
	Object       *unstructured.Unstructured              `json:"object"`
	Dependents   map[string][]*unstructured.Unstructured `json:"dependents,omitempty"`
	References   map[string][]*unstructured.Unstructured `json:"references,omitempty"`
	Events       []Event                                 `json:"events,omitempty"`
	Requeue      bool                                    `json:"requeue,omitempty"`
	RequeueAfter int                                     `json:"requeueAfter,omitempty"`
}

State is passed to and received from handler.

func New

func New(object *unstructured.Unstructured, deps, refs map[string][]*unstructured.Unstructured) *State

NewState returns a new state with specified object.

func (*State) Copy

func (s *State) Copy() *State

Copy returns a copy of current state.

func (*State) Diff

Diff compares two states and returns lists of modified objects.

Jump to

Keyboard shortcuts

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