task_store

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2016 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Dir              string        `toml:"dir"`
	SnapshotInterval toml.Duration `toml:"snapshot-interval"`
}

func NewConfig

func NewConfig() Config

func (Config) Validate

func (c Config) Validate() error

type Service

type Service struct {
	HTTPDService interface {
		AddRoutes([]httpd.Route) error
		DelRoutes([]httpd.Route)
	}
	TaskMaster interface {
		NewTask(
			name,
			script string,
			tt kapacitor.TaskType,
			dbrps []kapacitor.DBRP,
			snapshotInterval time.Duration,
		) (*kapacitor.Task, error)
		StartTask(t *kapacitor.Task) (*kapacitor.ExecutingTask, error)
		StopTask(name string) error
		IsExecuting(name string) bool
		ExecutionStats(name string) (kapacitor.ExecutionStats, error)
		ExecutingDot(name string, labels bool) string
	}
	// contains filtered or unexported fields
}

func NewService

func NewService(conf Config, l *log.Logger) *Service

func (*Service) Close

func (ts *Service) Close() error

func (*Service) CreateTaskFromRaw added in v0.12.0

func (ts *Service) CreateTaskFromRaw(task *rawTask) (*kapacitor.Task, error)

func (*Service) Delete

func (ts *Service) Delete(pattern string) error

func (*Service) Disable

func (ts *Service) Disable(pattern string) error

func (*Service) Enable

func (ts *Service) Enable(pattern string) error

func (*Service) FindTasks added in v0.12.0

func (ts *Service) FindTasks(predicate func(string) (bool, error)) ([]*rawTask, error)

Returns all taskInfo of task name that matches the predicate

func (*Service) GetTaskSummaryInfo added in v0.11.0

func (ts *Service) GetTaskSummaryInfo(tasks []string) ([]TaskSummaryInfo, error)

func (*Service) HasSnapshot added in v0.10.0

func (ts *Service) HasSnapshot(name string) bool

func (*Service) IsEnabled

func (ts *Service) IsEnabled(name string) (e bool)

func (*Service) Load

func (ts *Service) Load(name string) (*kapacitor.Task, error)

func (*Service) LoadRaw

func (ts *Service) LoadRaw(name string) (*rawTask, error)

func (*Service) LoadSnapshot added in v0.10.0

func (ts *Service) LoadSnapshot(name string) (*kapacitor.TaskSnapshot, error)

func (*Service) Open

func (ts *Service) Open() error

func (*Service) Save

func (ts *Service) Save(task *rawTask) error

func (*Service) SaveLastError added in v0.2.1

func (ts *Service) SaveLastError(name string, errStr string) error

Save last error from task.

func (*Service) SaveSnapshot added in v0.10.0

func (ts *Service) SaveSnapshot(name string, snapshot *kapacitor.TaskSnapshot) error

func (*Service) StartTask

func (ts *Service) StartTask(t *kapacitor.Task) error

type TaskInfo

type TaskInfo struct {
	Name           string
	Type           kapacitor.TaskType
	DBRPs          []kapacitor.DBRP
	TICKscript     string
	Dot            string
	Enabled        bool
	Executing      bool
	Error          string
	ExecutionStats kapacitor.ExecutionStats
}

type TaskSummaryInfo added in v0.11.0

type TaskSummaryInfo struct {
	Name           string
	Type           kapacitor.TaskType
	DBRPs          []kapacitor.DBRP
	Enabled        bool
	Executing      bool
	ExecutionStats kapacitor.ExecutionStats
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL