Documentation ¶
Index ¶
- func LocalFirst() funcopt.O
- func WithAsyncFunc(f func(context.Context) error) funcopt.O
- func WithAsyncTarget(s string) funcopt.O
- func WithAsyncTime(d time.Duration) funcopt.O
- func WithAsyncWait(v bool) funcopt.O
- func WithAsyncWaitNode(s string) funcopt.O
- func WithAsyncWatch(v bool) funcopt.O
- func WithColor(s string) funcopt.O
- func WithFormat(s string) funcopt.O
- func WithLocal(v bool) funcopt.O
- func WithLocalFunc(f func() (any, error)) funcopt.O
- func WithRemoteFunc(f func(context.Context, string) (any, error)) funcopt.O
- func WithRemoteNodes(s string) funcopt.O
- func WithServer(s string) funcopt.O
- type Expectation
- 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 WithAsyncFunc ¶
WithAsyncFunc sets a function to run if the action is async
func WithAsyncTarget ¶
WithAsyncTarget is the node or object state the daemons should orchestrate to reach.
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 reached
func WithAsyncWaitNode ¶
func WithAsyncWatch ¶
WithAsyncWatch runs an 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 WithFormat ¶
WithFormat 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 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 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.
Types ¶
type Expectation ¶
type Expectation any
type T ¶
type T struct { actionrouter.T AsyncWaitNode string AsyncFunc func(context.Context) error LocalFunc func() (any, error) RemoteFunc func(context.Context, string) (any, error) }
T has is an actionrouter.T with a node func
func (T) DoAsync ¶
DoAsync uses the agent API to submit a target state to reach via an orchestration.