Documentation ¶
Index ¶
- Constants
- Variables
- func WrapKube(parent runtime.Object, parentGvk schema.GroupVersionKind, obj runtime.Object) (runtime.Object, error)
- func WrapMem(parent runtime.Object, parentGvk schema.GroupVersionKind, obj runtime.Object) (runtime.Object, error)
- type Descriptor
- type FuncReaderWriter
- type ListMetas
- type Node
- type NodeProcessor
- type NopReaderWriter
- type ProcessOptions
- type Reader
- type ReaderWriter
- type ReaderWriterCreator
- type ReaderWriterPair
- type SelectorProvider
- type Writer
Constants ¶
const ( // KubeType read/write from/to kubenetes. KubeType = "kube" // MemType read/write from/to memory. MemType = "mem" // NopType no operation NopType = "nop" )
const ( // OwnerLabelKey the label key in ListMetas OwnerLabelKey = "owner-label" // OwnerHashLabelKey get the owner hash OwnerHashLabelKey = "owner-hash-label" )
Variables ¶
var ( // ErrWrongTypeObject the object is not unstructured object ErrWrongTypeObject = errors.New("runtime.Object is not unstructured object") )
Functions ¶
Types ¶
type Descriptor ¶
type Descriptor struct { Resource string `json:"resource"` Kind string `json:"kind"` Source string `json:"source"` Destination string `json:"destination"` Metas ListMetas `json:"metas"` GroupVersion string `json:"groupVersion,omitempty"` // if empty, use default }
Descriptor the resource/object descrptor.
type FuncReaderWriter ¶
type FuncReaderWriter struct { WriteFunc func(runtime.Object) error WrapFunc func(parent runtime.Object, parentGvk schema.GroupVersionKind, obj runtime.Object) (runtime.Object, error) ListFunc func(runtime.Object, ListMetas) ([]runtime.Object, error) Name string }
FuncReaderWriter wraps functions as a ReaderWriter.
type ListMetas ¶
type ListMetas struct { Selectors map[string]string `json:"selectors,omitempty"` Config map[string]string `json:"config,omitempty"` }
ListMetas payload arguments to List.
type Node ¶
type Node struct { Reader Reader Writer Writer Gvk schema.GroupVersionKind Metas ListMetas }
Node represents a type of object in the transition chain.
type NodeProcessor ¶
type NodeProcessor struct { Node // contains filtered or unexported fields }
NodeProcessor process one node.
func CreateNodeProcessors ¶
func CreateNodeProcessors(gv schema.GroupVersion, descriptors []*Descriptor, creator ReaderWriterCreator) (*NodeProcessor, error)
CreateNodeProcessors create node processors. gv is the default GroupVersion, use descriptor GroupVersion if it's configed.
func (*NodeProcessor) Child ¶
func (p *NodeProcessor) Child(n Node) *NodeProcessor
Child creates a child node from this node.
func (*NodeProcessor) Process ¶
func (p *NodeProcessor) Process(opts *ProcessOptions) error
Process starts to process the transition.
type NopReaderWriter ¶
type NopReaderWriter struct { }
NopReaderWriter nop
type ProcessOptions ¶
ProcessOptions options for Process.
type ReaderWriter ¶
ReaderWriter read and write objects.
type ReaderWriterCreator ¶
type ReaderWriterCreator func(gvr schema.GroupVersionResource) ReaderWriterPair
ReaderWriterCreator used to create ReaderWriters
func NewDynamicReaderWriterCreator ¶
func NewDynamicReaderWriterCreator(ns string, kubeapis dynamic.Interface, memclient *client.DynamicClient) ReaderWriterCreator
NewDynamicReaderWriterCreator setup a creator
type ReaderWriterPair ¶
type ReaderWriterPair struct { KubeReaderWriter ReaderWriter MemReaderWriter ReaderWriter }
ReaderWriterPair holds ReaderWriters
type SelectorProvider ¶
SelectorProvider provides selector in ListOptions