Documentation ¶
Index ¶
- Constants
- Variables
- func CheekPath() string
- func InitDB(db *sqlx.DB) error
- func JobRunWebhookCall(jr *JobRun, webhookURL string, webhookType string) ([]byte, error)
- func NewDBLogWriter(db *sqlx.DB) io.Writer
- func NewLogger(logLevel string, db *sqlx.DB, extraWriters ...io.Writer) zerolog.Logger
- func OpenDB(dbPath string) (*sqlx.DB, error)
- func PrettyStdout() io.Writer
- func RunSchedule(log zerolog.Logger, cfg Config, scheduleFn string) error
- type Config
- type DBLogWriter
- type JobRun
- type JobSpec
- type OnEvent
- type Response
- type Schedule
- type ScheduleStatusResponse
- type TemplateData
- type VersionResponse
Constants ¶
View Source
const ( StatusOK int = 0 StatusError int = -1 )
Global status constants
Variables ¶
View Source
var Version = "development"
Version will be set through build flags used to print version via cmd.
Functions ¶
func JobRunWebhookCall ¶
func NewLogger ¶
Configures the package's global logger, also allows to pass in custom writers for testing purposes.
func PrettyStdout ¶
Types ¶
type Config ¶
type DBLogWriter ¶ added in v0.3.34
type DBLogWriter struct {
// contains filtered or unexported fields
}
type JobRun ¶
type JobRun struct { LogEntryId int `json:"id,omitempty" db:"id"` Status *int `json:"status,omitempty" db:"status,omitempty"` Log string `json:"log" db:"message"` Name string `json:"name" db:"job"` TriggeredAt time.Time `json:"triggered_at" db:"triggered_at"` TriggeredBy string `json:"triggered_by" db:"triggered_by,omitempty"` Triggered []string `json:"triggered,omitempty"` Duration time.Duration `json:"duration,omitempty" db:"duration"` // contains filtered or unexported fields }
JobRun holds information about a job execution.
type JobSpec ¶
type JobSpec struct { Yaml string `yaml:"-" json:"yaml,omitempty"` Cron string `yaml:"cron,omitempty" json:"cron,omitempty"` Command stringArray `yaml:"command" json:"command"` OnSuccess OnEvent `yaml:"on_success,omitempty" json:"on_success,omitempty"` OnError OnEvent `yaml:"on_error,omitempty" json:"on_error,omitempty"` Name string `json:"name"` Retries int `yaml:"retries,omitempty" json:"retries,omitempty"` Env map[string]secret `yaml:"env,omitempty"` WorkingDirectory string `yaml:"working_directory,omitempty" json:"working_directory,omitempty"` Runs []JobRun `json:"runs" yaml:"-"` // contains filtered or unexported fields }
JobSpec holds specifications and metadata of a job.
func (*JobSpec) ValidateCron ¶
type OnEvent ¶
type OnEvent struct { TriggerJob []string `yaml:"trigger_job,omitempty" json:"trigger_job,omitempty"` NotifyWebhook []string `yaml:"notify_webhook,omitempty" json:"notify_webhook,omitempty"` NotifySlackWebhook []string `yaml:"notify_slack_webhook,omitempty" json:"notify_slack_webhook,omitempty"` }
OnEvent contains specs on what needs to happen after a job event.
type Schedule ¶
type Schedule struct { Jobs map[string]*JobSpec `yaml:"jobs" json:"jobs"` OnSuccess OnEvent `yaml:"on_success,omitempty" json:"on_success,omitempty"` OnError OnEvent `yaml:"on_error,omitempty" json:"on_error,omitempty"` TZLocation string `yaml:"tz_location,omitempty" json:"tz_location,omitempty"` // contains filtered or unexported fields }
Schedule defines specs of a job schedule.
type ScheduleStatusResponse ¶ added in v1.0.10
type TemplateData ¶ added in v0.3.34
type TemplateData struct {
Name string
}
type VersionResponse ¶ added in v1.0.13
Source Files ¶
Click to show internal directories.
Click to hide internal directories.