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) 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
- 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, args util.ValueMap, logger util.Logger, ...) *Result
- func (s *Service) RunAll(ctx context.Context, task *Task, argsSet []util.ValueMap, logger util.Logger, ...) (Results, error)
- type Task
- func (t *Task) Clone() *Task
- func (t *Task) IconSafe() string
- func (t *Task) Run(ctx context.Context, args util.ValueMap, logger util.Logger, fns ...exec.OutFn) *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) WithTags(tags []string) *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"`
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 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 func() util.FieldDescs `json:"args,omitempty"`
Dangerous string `json:"dangerous,omitempty"`
WebURL string `json:"webURL,omitempty"`
MaxConcurrent int `json:"maxConcurrent,omitempty"`
// contains filtered or unexported fields
}
func (*Task) RunWithResult ¶
Click to show internal directories.
Click to hide internal directories.