controller

package
v0.0.0-...-b6983a5 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2017 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GitStructureByDevice = "by_device"
	GitStructureByJob    = "by_job"
	GitDirPerm           = 0755
	GitFilePerm          = 0644
)
View Source
const MaxJobBytes int64 = 524288000

500 meg

Variables

View Source
var Verbose bool

TODO: maybe remove this as a global var

Functions

func RunController

func RunController(configFilename string) error

configFileName can be empty which means default config

Types

type Controller

type Controller struct {
	JobStore
	DeviceStore
	DataStore
	Scheduler
	// contains filtered or unexported fields
}

func NewController

func NewController(conf *config.Config) (*Controller, error)

func (*Controller) NewLocalScheduler

func (c *Controller) NewLocalScheduler() (Scheduler, error)

func (*Controller) Start

func (c *Controller) Start() error

type DataStore

type DataStore interface {
	Store(job *DataStoreJob)
}

func NewDataStoreFromConfig

func NewDataStoreFromConfig(conf *config.DataStore) (DataStore, error)

type DataStoreJob

type DataStoreJob struct {
	DeviceName string
	JobName    string
	JobTime    time.Time
	StartTime  time.Time
	EndTime    time.Time
	Failure    string
	// TODO: worries about this eating too much mem?
	// Problem is we can't store reader because HTTP request is long gone
	Contents []byte
}

type DeviceStore

type DeviceStore interface {
	AllDevices() map[string]*model.Device
}

func NewDeviceStoreFromConfig

func NewDeviceStoreFromConfig(conf *config.DeviceStore, jobStore JobStore) (DeviceStore, error)

type JobStore

type JobStore interface {
	AllJobs() map[string]*model.Job
}

func NewJobStoreFromConfig

func NewJobStoreFromConfig(conf *config.JobStore) (JobStore, error)

type Scheduler

type Scheduler interface {
	NextExecution(tags []string, before time.Time) *model.Execution
}

Jump to

Keyboard shortcuts

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