Documentation ¶
Index ¶
- func LocalFirst() funcopt.O
- func WithAsyncTarget(s string) funcopt.O
- func WithAsyncTargetOptions(o any) funcopt.O
- func WithAsyncTime(d time.Duration) funcopt.O
- func WithAsyncWait(v bool) funcopt.O
- func WithAsyncWatch(v bool) funcopt.O
- func WithColor(s string) funcopt.O
- func WithDefaultOutput(s string) funcopt.O
- func WithLocal(v bool) funcopt.O
- func WithLocalFunc(f func(context.Context, naming.Path) (any, error)) funcopt.O
- func WithObjectSelector(s string) funcopt.O
- func WithOutput(s string) funcopt.O
- func WithRID(s string) funcopt.O
- func WithRemoteFunc(f func(context.Context, naming.Path, string) (any, error)) funcopt.O
- func WithRemoteNodes(s string) funcopt.O
- func WithSubset(s string) funcopt.O
- func WithTag(s string) funcopt.O
- type T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LocalFirst ¶
LocalFirst makes actions not explicitely Local nor remoted via NodeSelector be treated as local (CRM level).
func WithAsyncTarget ¶
WithAsyncTarget is the node or object state the daemons should orchestrate to reach.
func WithAsyncTargetOptions ¶
WithAsyncTargetOptions is the options of the target defined by WithAsyncTarget.
func WithAsyncTime ¶
WithAsyncTime is the maximum duration to wait for an async action It needs WithAsyncWait(true)
func WithAsyncWait ¶
WithAsyncWait runs an event-watcher waiting for target state, global expect return to none
func WithAsyncWatch ¶
WithAsyncWatch runs a event-driven monitor on the selected objects after setting a new target. So the operator can see the orchestration unfolding.
func WithColor ¶
WithColor activates the colorization of outputs auto => yes if os.Stdout is a tty yes no
func WithDefaultOutput ¶
func WithLocal ¶
WithLocal routes the action to the CRM instead of remoting it via orchestration or remote execution.
func WithLocalFunc ¶
WithLocalFunc sets a function to run if the action is local
func WithObjectSelector ¶
WithObjectSelector expands into a selection of objects to execute the action on.
func WithOutput ¶
WithOutput controls the output data format. <empty> => human readable format json => json machine readable format flat => flattened json (<k>=<v>) machine readable format flat_json => same as flat (backward compat)
func WithRemoteFunc ¶
WithRemoteFunc sets a function to run if the action is local
func WithRemoteNodes ¶
WithRemoteNodes expands into a selection of nodes to execute the action on.
func WithSubset ¶
WithSubset expands into a selection of resources to execute the action on.
Types ¶
type T ¶
type T struct { actionrouter.T LocalFunc func(context.Context, naming.Path) (any, error) RemoteFunc func(context.Context, naming.Path, string) (any, error) }
T has the same attributes as Action, but the interface method implementation differ.
func New ¶
New allocates a new client configuration and returns the reference so users are not tempted to use client.Config{} dereferenced, which would make loadContext useless.
func (T) DoAsync ¶
DoAsync uses the agent API to submit a target state to reach via an orchestration.