Documentation ¶
Overview ¶
Package jobs manages the configuration and execution of the jobs
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Name string `mapstructure:"name"` Exec interface{} `mapstructure:"exec"` // service discovery Port int `mapstructure:"port"` InitialStatus string `mapstructure:"initial_status"` Interfaces interface{} `mapstructure:"interfaces"` Tags []string `mapstructure:"tags"` ConsulExtras *ConsulExtras `mapstructure:"consul"` // health checking Health *HealthConfig `mapstructure:"health"` // timeouts and restarts ExecTimeout string `mapstructure:"timeout"` Restarts interface{} `mapstructure:"restarts"` StopTimeout string `mapstructure:"stopTimeout"` // related jobs and frequency When *WhenConfig `mapstructure:"when"` // logging Logging *LoggingConfig `mapstructure:"logging"` // contains filtered or unexported fields }
Config holds the configuration for service discovery data
func NewConfigs ¶
NewConfigs parses json config into a validated slice of Configs
type ConsulExtras ¶
type ConsulExtras struct { EnableTagOverride bool `mapstructure:"enableTagOverride"` DeregisterCriticalServiceAfter string `mapstructure:"deregisterCriticalServiceAfter"` }
ConsulExtras handles additional Consul configuration.
type HealthConfig ¶
type HealthConfig struct { CheckExec interface{} `mapstructure:"exec"` CheckTimeout string `mapstructure:"timeout"` Heartbeat int `mapstructure:"interval"` // time in seconds TTL int `mapstructure:"ttl"` // time in seconds Logging *LoggingConfig `mapstructure:"logging"` }
HealthConfig configures the Job's health checks
type Job ¶
type Job struct { Name string // service health and discovery Status JobStatus Service *discovery.ServiceDefinition // completed IsComplete bool events.Subscriber events.Publisher // contains filtered or unexported fields }
Job manages the state of a job and its start/stop conditions
func FromConfigs ¶
FromConfigs creates Jobs from a slice of validated Configs
func (*Job) SendHeartbeat ¶
func (job *Job) SendHeartbeat()
SendHeartbeat sends a heartbeat for this Job's service
type LoggingConfig ¶
type LoggingConfig struct {
Raw bool `mapstructure:"raw"`
}
LoggingConfig handles job-specific logging fields
type WhenConfig ¶
type WhenConfig struct { Frequency string `mapstructure:"interval"` Source string `mapstructure:"source"` Once string `mapstructure:"once"` Each string `mapstructure:"each"` Timeout string `mapstructure:"timeout"` }
WhenConfig determines when a Job runs (dependencies on other Jobs, Watches, or frequency timers)
Click to show internal directories.
Click to hide internal directories.