Documentation
¶
Index ¶
- func LocalFirst() funcopt.O
- func WithAsyncFollow(v bool) funcopt.O
- func WithAsyncFunc(f func(context.Context) (uuid.UUID, error)) funcopt.O
- func WithAsyncTarget(s string) 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 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 WithSort(s string) funcopt.O
- type T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LocalFirst ¶
LocalFirst makes actions not explicitly Local nor remoted via NodeSelector be treated as local (CRM level).
func WithAsyncFollow ¶
WithAsyncFollow streams the logs of the action until it ends, rather than answering the ids it was accepted as: the logs of its session for an action asked of the daemons of nodes, of its orchestration for a target state.
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 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 remote
func WithRemoteNodes ¶
WithRemoteNodes expands into a selection of nodes to execute the action on.
Types ¶
type T ¶
type T struct {
actionrouter.T
// AsyncFunc submits the action and answers the orchestration it was
// accepted as, which is what a wait waits for.
AsyncFunc func(context.Context) (uuid.UUID, 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.