Documentation ¶
Index ¶
- type CoordinatingCheckService
- func (cs *CoordinatingCheckService) CreateCheck(ctx context.Context, c influxdb.CheckCreate, userID platform.ID) error
- func (cs *CoordinatingCheckService) DeleteCheck(ctx context.Context, id platform.ID) error
- func (cs *CoordinatingCheckService) PatchCheck(ctx context.Context, id platform.ID, upd influxdb.CheckUpdate) (influxdb.Check, error)
- func (cs *CoordinatingCheckService) UpdateCheck(ctx context.Context, id platform.ID, c influxdb.CheckCreate) (influxdb.Check, error)
- type CoordinatingNotificationRuleStore
- func (ns *CoordinatingNotificationRuleStore) CreateNotificationRule(ctx context.Context, nr influxdb.NotificationRuleCreate, userID platform.ID) error
- func (ns *CoordinatingNotificationRuleStore) DeleteNotificationRule(ctx context.Context, id platform.ID) error
- func (ns *CoordinatingNotificationRuleStore) PatchNotificationRule(ctx context.Context, id platform.ID, upd influxdb.NotificationRuleUpdate) (influxdb.NotificationRule, error)
- func (ns *CoordinatingNotificationRuleStore) UpdateNotificationRule(ctx context.Context, id platform.ID, nr influxdb.NotificationRuleCreate, ...) (influxdb.NotificationRule, error)
- type CoordinatingTaskService
- func (s *CoordinatingTaskService) CancelRun(ctx context.Context, taskID, runID platform.ID) error
- func (s *CoordinatingTaskService) CreateTask(ctx context.Context, tc taskmodel.TaskCreate) (*taskmodel.Task, error)
- func (s *CoordinatingTaskService) DeleteTask(ctx context.Context, id platform.ID) error
- func (s *CoordinatingTaskService) ForceRun(ctx context.Context, taskID platform.ID, scheduledFor int64) (*taskmodel.Run, error)
- func (s *CoordinatingTaskService) RetryRun(ctx context.Context, taskID, runID platform.ID) (*taskmodel.Run, error)
- func (s *CoordinatingTaskService) UpdateTask(ctx context.Context, id platform.ID, upd taskmodel.TaskUpdate) (*taskmodel.Task, error)
- type Coordinator
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CoordinatingCheckService ¶
type CoordinatingCheckService struct { influxdb.CheckService Now func() time.Time // contains filtered or unexported fields }
CoordinatingCheckService acts as a CheckService decorator that handles coordinating the api request with the required task control actions asynchronously via a message dispatcher
func NewCheckService ¶
func NewCheckService(cs influxdb.CheckService, ts taskmodel.TaskService, coordinator Coordinator) *CoordinatingCheckService
NewCheckService constructs a new coordinating check service
func (*CoordinatingCheckService) CreateCheck ¶
func (cs *CoordinatingCheckService) CreateCheck(ctx context.Context, c influxdb.CheckCreate, userID platform.ID) error
CreateCheck Creates a check and Publishes the change it can be scheduled.
func (*CoordinatingCheckService) DeleteCheck ¶
DeleteCheck delete the check and publishes the change, to allow the task owner to find out about this change faster.
func (*CoordinatingCheckService) PatchCheck ¶
func (cs *CoordinatingCheckService) PatchCheck(ctx context.Context, id platform.ID, upd influxdb.CheckUpdate) (influxdb.Check, error)
PatchCheck Updates a check and publishes the change so the task owner can act on the update
func (*CoordinatingCheckService) UpdateCheck ¶
func (cs *CoordinatingCheckService) UpdateCheck(ctx context.Context, id platform.ID, c influxdb.CheckCreate) (influxdb.Check, error)
UpdateCheck Updates a check and publishes the change so the task owner can act on the update
type CoordinatingNotificationRuleStore ¶
type CoordinatingNotificationRuleStore struct { influxdb.NotificationRuleStore Now func() time.Time // contains filtered or unexported fields }
CoordinatingNotificationRuleStore acts as a NotificationRuleStore decorator that handles coordinating the api request with the required task control actions asynchronously via a message dispatcher
func NewNotificationRuleStore ¶
func NewNotificationRuleStore(ns influxdb.NotificationRuleStore, ts taskmodel.TaskService, coordinator Coordinator) *CoordinatingNotificationRuleStore
NewNotificationRuleStore constructs a new coordinating notification service
func (*CoordinatingNotificationRuleStore) CreateNotificationRule ¶
func (ns *CoordinatingNotificationRuleStore) CreateNotificationRule(ctx context.Context, nr influxdb.NotificationRuleCreate, userID platform.ID) error
CreateNotificationRule Creates a notification and Publishes the change it can be scheduled.
func (*CoordinatingNotificationRuleStore) DeleteNotificationRule ¶
func (ns *CoordinatingNotificationRuleStore) DeleteNotificationRule(ctx context.Context, id platform.ID) error
DeleteNotificationRule delete the notification and publishes the change, to allow the task owner to find out about this change faster.
func (*CoordinatingNotificationRuleStore) PatchNotificationRule ¶
func (ns *CoordinatingNotificationRuleStore) PatchNotificationRule(ctx context.Context, id platform.ID, upd influxdb.NotificationRuleUpdate) (influxdb.NotificationRule, error)
PatchNotificationRule Updates a notification and publishes the change so the task owner can act on the update
func (*CoordinatingNotificationRuleStore) UpdateNotificationRule ¶
func (ns *CoordinatingNotificationRuleStore) UpdateNotificationRule(ctx context.Context, id platform.ID, nr influxdb.NotificationRuleCreate, uid platform.ID) (influxdb.NotificationRule, error)
UpdateNotificationRule Updates a notification and publishes the change so the task owner can act on the update
type CoordinatingTaskService ¶
type CoordinatingTaskService struct { taskmodel.TaskService // contains filtered or unexported fields }
CoordinatingTaskService acts as a TaskService decorator that handles coordinating the api request with the required task control actions asynchronously via a message dispatcher
func New ¶
func New(service taskmodel.TaskService, coordinator Coordinator, opts ...Option) *CoordinatingTaskService
New constructs a new coordinating task service
func (*CoordinatingTaskService) CreateTask ¶
func (s *CoordinatingTaskService) CreateTask(ctx context.Context, tc taskmodel.TaskCreate) (*taskmodel.Task, error)
CreateTask Creates a task in the existing task service and Publishes the change so any TaskD service can lease it.
func (*CoordinatingTaskService) DeleteTask ¶
DeleteTask delete the task and publishes the change, to allow the task owner to find out about this change faster.
func (*CoordinatingTaskService) ForceRun ¶
func (s *CoordinatingTaskService) ForceRun(ctx context.Context, taskID platform.ID, scheduledFor int64) (*taskmodel.Run, error)
ForceRun create the forced run in the task system and publish to the pubSub.
func (*CoordinatingTaskService) RetryRun ¶
func (s *CoordinatingTaskService) RetryRun(ctx context.Context, taskID, runID platform.ID) (*taskmodel.Run, error)
RetryRun calls retry on the task service and publishes the retry.
func (*CoordinatingTaskService) UpdateTask ¶
func (s *CoordinatingTaskService) UpdateTask(ctx context.Context, id platform.ID, upd taskmodel.TaskUpdate) (*taskmodel.Task, error)
UpdateTask Updates a task and publishes the change so the task owner can act on the update
type Coordinator ¶
type Coordinator interface { TaskCreated(context.Context, *taskmodel.Task) error TaskUpdated(ctx context.Context, from, to *taskmodel.Task) error TaskDeleted(context.Context, platform.ID) error RunCancelled(ctx context.Context, runID platform.ID) error RunForced(ctx context.Context, task *taskmodel.Task, run *taskmodel.Run) error }
Coordinator is a type which is used to react to task related actions
type Option ¶
type Option func(*CoordinatingTaskService)
Option is a functional option for the coordinating task service
func WithNowFunc ¶
WithNowFunc sets the now func used to derive time