Documentation ¶
Index ¶
- Constants
- type Config
- type Connection
- func (c *Connection) Close() error
- func (c *Connection) Connect() error
- func (c *Connection) ReadAll() (tasks []provider.Task, err error)
- func (c *Connection) ReadTask(key string, task *provider.Task) error
- func (c *Connection) WatchTasks(cb func(t provider.Task))
- func (c *Connection) WriteTask(t *provider.Task) error
- type SourceProvider
- func (p SourceProvider) OnTaskUpdate(fn func(*provider.Task) error)
- func (p *SourceProvider) Read() (err error)
- func (p SourceProvider) Stop() error
- func (p SourceProvider) String() string
- func (p SourceProvider) TaskDone(t *provider.Task) error
- func (p SourceProvider) TaskError(t *provider.Task, err error) error
- func (p SourceProvider) TaskStarted(t *provider.Task) error
Constants ¶
View Source
const ( // DefaultEnabled defines a state for default config DefaultEnabled = false // DefaultDatabaseURI defines the default contact point towards the mysql server instance DefaultDatabaseURI = "/tmp/asparagus.db" // DefaultDriver defines a default driver for the sql package DefaultDriver = "sqlite3" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Enabled bool `toml:"enabled"` DatabaseURI string `toml:"uri"` DatabaseDriver string `toml:"driver"` }
Config represents a configuration for a HTTP service.
type Connection ¶
Connection defines a wrapper for the actual etcd connection
func NewConnection ¶
func NewConnection(config Config) *Connection
NewConnection creates a new etcd connection
func (*Connection) Close ¶
func (c *Connection) Close() error
func (*Connection) ReadAll ¶
func (c *Connection) ReadAll() (tasks []provider.Task, err error)
ReadAll reads all cronjobs inside a directory
func (*Connection) ReadTask ¶
func (c *Connection) ReadTask(key string, task *provider.Task) error
ReadTask reads a task from etcd
func (*Connection) WatchTasks ¶
func (c *Connection) WatchTasks(cb func(t provider.Task))
WatchTasks looks for new keys inside etcd
type SourceProvider ¶
type SourceProvider struct { Config Config Connection *Connection TaskFlow chan provider.Task QuitChan chan bool }
SourceProvider creates a new src provider
func NewSourceProvider ¶
func NewSourceProvider(config Config) *SourceProvider
NewSourceProvider creates a new src provider
func (SourceProvider) OnTaskUpdate ¶
func (p SourceProvider) OnTaskUpdate(fn func(*provider.Task) error)
OnTaskUpdate runs when a task gets updated
func (SourceProvider) String ¶
func (p SourceProvider) String() string
String returns the Providers identity
func (SourceProvider) TaskDone ¶
func (p SourceProvider) TaskDone(t *provider.Task) error
TaskDone will be executed when a task is done
func (SourceProvider) TaskError ¶
func (p SourceProvider) TaskError(t *provider.Task, err error) error
TaskError will be called when an error occured
func (SourceProvider) TaskStarted ¶
func (p SourceProvider) TaskStarted(t *provider.Task) error
TaskStarted will be executed when a task is started
Click to show internal directories.
Click to hide internal directories.