Documentation ¶
Index ¶
- Constants
- type Config
- type Connection
- type SourceProvider
- func (p SourceProvider) OnTaskUpdate(fn func(*provider.Task) error)
- func (p *SourceProvider) Read() 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 // DefaultRegistryURL defines the default contact point DefaultRegistryURL = "http://127.0.0.1:4001" //DefaultUseDNSDiscovery defines if dns discovery should be used by default DefaultUseDNSDiscovery = false //DefaultDiscoveryDomain represents a domain name to resolve the SRV record from. DefaultDiscoveryDomain = "example.com" // DefaultCA defines a default location for the ca cert. DefaultCA = "" // DefaultSourceFolder defines a safe default for job sources DefaultSourceFolder = "/cron/Jobs" // DefaultJSONSingleDepth let's you use a flat directory structure inside etcd // instead of the file based one (could be a bit faster and less heavy on your network) DefaultJSONSingleDepth = true )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Enabled bool `toml:"enabled"` RegistryURL []string `toml:"registry-url"` UseDNSDiscovery bool `toml:"discovery-enabled"` DiscoveryDomain string `toml:"discovery-domain"` CACert string `toml:"connect-ca-cert"` SourceFolder string `toml:"source-folder"` UseJSONSingleDepth bool `toml:"json-single-depth"` }
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) ReadAll ¶
func (c *Connection) ReadAll(tasks *[]provider.Task) error
ReadAll reads all cronjobs inside a directory
func (*Connection) ReadTask ¶
func (c *Connection) ReadTask(key string, t *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 ¶ added in v0.7.0
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.