Documentation
¶
Index ¶
- func MustServe(plugin *Plugin)
- type Flag
- type LockMode
- type Options
- type Plugin
- func (t *Plugin) CollectSpecs(ctx context.Context) ([]byte, error)
- func (t Plugin) Do(ctx context.Context, task string, input *proto.Input) (core.Response, error)
- func (t Plugin) GetTaskLockMode(taskName string) (proto.LockMode, error)
- func (t Plugin) Help(taskName string) (map[string]string, error)
- func (t *Plugin) MustRegisterSpecCollector(name string, function any) *SpecCollector
- func (t *Plugin) MustRegisterTask(name string, function any) *Task
- func (t Plugin) Name() (string, error)
- func (t Plugin) Tasks() ([]string, error)
- func (t Plugin) Version() (core.Version, error)
- type SpecCollector
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LockMode ¶
type LockMode int
LockMode represents the locking behavior for task execution.
const ( // NoLock allows concurrent execution without any locking restrictions (default). NoLock LockMode = iota // WriteLock allows only one write task at a time, but read tasks can run concurrently. WriteLock // ExclusiveLock ensures only one task runs at a time, blocking all others. // Be careful, it blocks any other tasks like specs refresh. // Usually for Jackadi internal operations. ExclusiveLock )
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func (Plugin) GetTaskLockMode ¶
func (*Plugin) MustRegisterSpecCollector ¶
func (t *Plugin) MustRegisterSpecCollector(name string, function any) *SpecCollector
MustRegister registers a task (function) with a string identifier.
func (*Plugin) MustRegisterTask ¶
MustRegisterTask registers a task (function) with a string identifier.
type SpecCollector ¶
type SpecCollector struct {
// contains filtered or unexported fields
}
func (*SpecCollector) WithDescription ¶
func (p *SpecCollector) WithDescription(text string) *SpecCollector
WithDescription set long description.
func (*SpecCollector) WithFlags ¶
func (p *SpecCollector) WithFlags(flags ...Flag) *SpecCollector
WithFlags add flags (e.g. Deprecated, NotImplemented, ...).
func (*SpecCollector) WithSummary ¶
func (p *SpecCollector) WithSummary(text string) *SpecCollector
WithSummary set the short description.
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
func (*Task) WithDescription ¶
WithDescription set long description.
func (*Task) WithLockMode ¶
WithLockMode sets the default lock mode for this task.
func (*Task) WithSummary ¶
WithSummary set the short description.
Click to show internal directories.
Click to hide internal directories.