Documentation ¶
Index ¶
- type Result
- func (r *Result) AddLogs(msgs ...string)
- func (r *Result) Complete(data any, errs ...error) *Result
- func (r *Result) CompleteError(err error) *Result
- func (r *Result) CompleteSimple(data any) *Result
- func (r *Result) DataMap() util.ValueMap
- func (r *Result) EndTime() time.Time
- func (r *Result) IsOK() bool
- func (r *Result) Log(msg string, args ...any)
- func (r *Result) String() string
- func (r *Result) Summarize() string
- type ResultLogFn
- type Results
- func (r Results) ForRun(run string) Results
- func (r Results) ForRunFirst(run string) *Result
- func (r Results) ForTask(act string) Results
- func (r Results) ForTaskFirst(act string) *Result
- func (r Results) Get(id uuid.UUID) *Result
- func (r Results) Keys() []string
- func (r Results) Statuses() ([]string, map[string]Results)
- func (r Results) String() string
- type Service
- func (s *Service) RegisterTask(t *Task) error
- func (s *Service) RemoveTask(key string) bool
- func (s *Service) Run(ctx context.Context, task *Task, run string, args util.ValueMap, ...) *Result
- func (s *Service) RunAll(ctx context.Context, task *Task, run string, argsSet []util.ValueMap, ...) (Results, error)
- type Task
- func (t *Task) Clone() *Task
- func (t *Task) IconSafe() string
- func (t *Task) ResultLogFn(logger util.Logger, fns ...exec.OutFn) ResultLogFn
- func (t *Task) Run(ctx context.Context, run string, args util.ValueMap, logger util.Logger, ...) *Result
- func (t *Task) RunWithResult(ctx context.Context, res *Result, logger util.Logger) *Result
- func (t *Task) TitleSafe() string
- func (t *Task) WebPath() string
- func (t *Task) WithFunction(fn TaskFn) *Task
- func (t *Task) WithTags(tags []string) *Task
- func (t *Task) WithoutFunctions() *Task
- type TaskFn
- type Tasks
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct { ID uuid.UUID `json:"id"` Task *Task `json:"task"` Run string `json:"run,omitempty"` Args util.ValueMap `json:"args,omitempty"` Started time.Time `json:"started,omitempty"` Elapsed int `json:"elapsed,omitempty"` Status string `json:"status,omitempty"` Summary string `json:"summary,omitempty"` Logs []string `json:"logs,omitempty"` Data any `json:"data,omitempty"` Metadata util.ValueMap `json:"metadata,omitempty"` Success bool `json:"success"` Error string `json:"error,omitempty"` // contains filtered or unexported fields }
func CompletedResult ¶
func (*Result) CompleteError ¶
func (*Result) CompleteSimple ¶
type ResultLogFn ¶
type Results ¶
type Results []*Result
func (Results) ForRunFirst ¶ added in v1.5.21
func (Results) ForTaskFirst ¶ added in v1.5.21
type Service ¶
type Service struct { RegisteredTasks Tasks `json:"tasks"` // contains filtered or unexported fields }
func NewService ¶
func NewService(fs filesystem.FileLoader, path string, initialTasks ...*Task) *Service
func (*Service) RegisterTask ¶
func (*Service) RemoveTask ¶
type Task ¶
type Task struct { Key string `json:"key"` Title string `json:"title,omitempty"` Category string `json:"category,omitempty"` Icon string `json:"icon,omitempty"` Description string `json:"description,omitempty"` Tags []string `json:"tags,omitempty"` Fields util.FieldDescs `json:"fields,omitempty"` Dangerous string `json:"dangerous,omitempty"` WebURL string `json:"webURL,omitempty"` MaxConcurrent int `json:"maxConcurrent,omitempty"` // contains filtered or unexported fields }
func (*Task) ResultLogFn ¶ added in v1.5.21
func (*Task) RunWithResult ¶
func (*Task) WithFunction ¶ added in v1.5.21
func (*Task) WithoutFunctions ¶ added in v1.5.21
Click to show internal directories.
Click to hide internal directories.