Documentation
¶
Overview ¶
Package scheduler provides portable scheduled-command tool coordination.
Index ¶
- Constants
- func Definition() toolcontract.Definition
- func NewHandler(backend Backend) toolcontract.Handler
- func Register(reg toolcontract.Registrar, backend Backend)
- type Backend
- type BackendFuncs
- func (b BackendFuncs) Add(ctx context.Context, request Request) (string, error)
- func (b BackendFuncs) List(ctx context.Context, request Request) (string, error)
- func (b BackendFuncs) Remove(ctx context.Context, request Request) (string, error)
- func (b BackendFuncs) Run(ctx context.Context, request Request) (string, error)
- func (b BackendFuncs) Status(ctx context.Context, request Request) (string, error)
- type Request
Constants ¶
View Source
const ( ActionAdd = "add" ActionList = "list" ActionStatus = "status" ActionRun = "run" ActionRemove = "remove" )
View Source
const Name = "cron"
Name is the catalog name of the scheduled-command tool.
Variables ¶
This section is empty.
Functions ¶
func Definition ¶
func Definition() toolcontract.Definition
Definition returns the stable scheduled-command tool schema.
func NewHandler ¶
func NewHandler(backend Backend) toolcontract.Handler
NewHandler constructs deterministic action routing over the Host backend.
func Register ¶
func Register(reg toolcontract.Registrar, backend Backend)
Register adds the scheduled-command tool when a Backend is available.
Types ¶
type Backend ¶
type Backend interface {
Add(context.Context, Request) (string, error)
List(context.Context, Request) (string, error)
Status(context.Context, Request) (string, error)
Run(context.Context, Request) (string, error)
Remove(context.Context, Request) (string, error)
}
Backend owns concrete scheduler, task/session store, authorization, visibility and durable-write behavior.
type BackendFuncs ¶
type BackendFuncs struct {
AddFunc func(context.Context, Request) (string, error)
ListFunc func(context.Context, Request) (string, error)
StatusFunc func(context.Context, Request) (string, error)
RunFunc func(context.Context, Request) (string, error)
RemoveFunc func(context.Context, Request) (string, error)
}
BackendFuncs adapts private Host functions to Backend.
Click to show internal directories.
Click to hide internal directories.