Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultHumanRenderer ¶
func DefaultHumanRenderer(data interface{}) string
Types ¶
type Actioner ¶
type Actioner interface { DoRemote() error DoLocal() error DoAsync() error HasLocal() bool Options() T }
Actioner is the interface implemented by nodeaction.T and objectaction.T
type Result ¶
type Result struct { Nodename string `json:"nodename"` Path naming.Path `json:"path,omitempty"` Data interface{} `json:"data"` Error error `json:"-"` Panic interface{} `json:"-"` HumanRenderer func() string `json:"-"` }
Result is a predictible type of actions return value, for reflect.
func (Result) Unstructured ¶
type T ¶
type T struct { Digest bool // // ObjectSelector expands into a selection of objects to execute // the action on. // ObjectSelector string // // NodeSelector expands into a selection of nodes to execute the // action on. // NodeSelector string RID string Subset string Tag string // // Local routes the action to the CRM instead of remoting it via // orchestration or remote execution. // Local bool // // DefaultIsLocal makes actions not explicitely Local nor remoted // via NodeSelector be treated as local (CRM level). // DefaultIsLocal bool // // Flags is the command flags as parsed by cobra. This is the struct // passed to the object method on local execution. // Flags any // // Target is the node or object state the daemons should orchestrate // to reach. // Target string // // TargetOptions is the options of the orchestration needed to reach // the Target. // TargetOptions any // Wait runs an event watcher to wait for target state or global expect reached Wait bool // WaitDuration is the maximum duration allowed for the Wait WaitDuration time.Duration // // Watch runs a event-driven monitor on the selected objects after // setting a new target. So the operator can see the orchestration // unfolding. // Watch bool // // Output controls the output data format. // <empty> => human readable format // tab=... => tubular customizable format // yaml => yaml machine readable format // json => json machine readable format // flat => flattened json (<k>=<v>) machine readable format // flat_json => same as flat (backward compat) // Output string // DefaultOutput defines a default output to use when Output is // not specified. DefaultOutput string // // Color activates the colorization of outputs // auto => yes if os.Stdout is a tty // yes // no // Color string }
T holds the action options common to all actioner implementations.
Click to show internal directories.
Click to hide internal directories.