Documentation
¶
Index ¶
- Variables
- type Config
- type DBRP
- type Service
- func (ts *Service) Close() error
- func (ts *Service) HasSnapshot(id string) bool
- func (ts *Service) Load(id string) (*kapacitor.Task, error)
- func (ts *Service) LoadSnapshot(id string) (*kapacitor.TaskSnapshot, error)
- func (ts *Service) Open() error
- func (ts *Service) SaveSnapshot(id string, snapshot *kapacitor.TaskSnapshot) error
- type Snapshot
- type SnapshotDAO
- type Status
- type Task
- type TaskDAO
- type TaskInfo
- type TaskType
- type Template
- type TemplateDAO
- type Var
- type VarType
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Service ¶
type Service struct {
StorageService interface {
Store(namespace string) storage.Interface
}
HTTPDService interface {
AddRoutes([]httpd.Route) error
DelRoutes([]httpd.Route)
}
TaskMasterLookup interface {
Main() *kapacitor.TaskMaster
Get(string) *kapacitor.TaskMaster
Set(*kapacitor.TaskMaster)
Delete(*kapacitor.TaskMaster)
}
// contains filtered or unexported fields
}
func (*Service) HasSnapshot ¶ added in v0.10.0
func (*Service) LoadSnapshot ¶ added in v0.10.0
func (ts *Service) LoadSnapshot(id string) (*kapacitor.TaskSnapshot, error)
func (*Service) SaveSnapshot ¶ added in v0.10.0
func (ts *Service) SaveSnapshot(id string, snapshot *kapacitor.TaskSnapshot) error
type SnapshotDAO ¶ added in v0.13.0
type SnapshotDAO interface {
// Load a saved snapshot.
// ErrNoSnapshotExists will be returned if the snapshot does not exist.
Get(id string) (*Snapshot, error)
// Save a snapshot.
Put(id string, snapshot *Snapshot) error
// Delete a snapshot
Delete(id string) error
// Whether a snapshot exists in the store.
Exists(id string) (bool, error)
}
Data access object for Snapshot data.
type Task ¶ added in v0.13.0
type Task struct {
// Unique identifier for the task
ID string
// The task type (stream|batch).
Type TaskType
// The DBs and RPs the task is allowed to access.
DBRPs []DBRP
// The TICKscript for the task.
TICKscript string
// ID of task template
TemplateID string
// Set of vars for a templated task
Vars map[string]Var
// Last error the task had either while defining or executing.
Error string
// Status of the task
Status Status
// Created Date
Created time.Time
// The time the task was last modified
Modified time.Time
// The time the task was last changed to status Enabled.
LastEnabled time.Time
}
type TaskDAO ¶ added in v0.13.0
type TaskDAO interface {
// Retrieve a task
Get(id string) (Task, error)
// Create a task.
// ErrTaskExists is returned if a task already exists with the same ID.
Create(t Task) error
// Replace an existing task.
// ErrNoTaskExists is returned if the task does not exist.
Replace(t Task) error
// Delete a task.
// It is not an error to delete an non-existent task.
Delete(id string) error
// List tasks matching a pattern.
// The pattern is shell/glob matching see https://golang.org/pkg/path/#Match
// Offset and limit are pagination bounds. Offset is inclusive starting at index 0.
// More results may exist while the number of returned items is equal to limit.
List(pattern string, offset, limit int) ([]Task, error)
}
Data access object for Task data.
type Template ¶ added in v1.0.0
type Template struct {
// Unique identifier for the task
ID string
// The task type (stream|batch).
Type TaskType
// The TICKscript for the task.
TICKscript string
// Last error the task had either while defining or executing.
Error string
// Created Date
Created time.Time
// The time the task was last modified
Modified time.Time
}
type TemplateDAO ¶ added in v1.0.0
type TemplateDAO interface {
// Retrieve a template
Get(id string) (Template, error)
// Create a template.
// ErrTemplateExists is returned if a template already exists with the same ID.
Create(t Template) error
// Replace an existing template.
// ErrNoTemplateExists is returned if the template does not exist.
Replace(t Template) error
// Delete a template.
// It is not an error to delete an non-existent template.
Delete(id string) error
// List templates matching a pattern.
// The pattern is shell/glob matching see https://golang.org/pkg/path/#Match
// Offset and limit are pagination bounds. Offset is inclusive starting at index 0.
// More results may exist while the number of returned items is equal to limit.
List(pattern string, offset, limit int) ([]Template, error)
// Associate a task with a template
AssociateTask(templateId, taskId string) error
// Disassociate a task with a template
DisassociateTask(templateId, taskId string) error
ListAssociatedTasks(templateId string) ([]string, error)
}
Data access object for Template data.
Click to show internal directories.
Click to hide internal directories.