Documentation
¶
Overview ¶
Package utils contains helper functions and structs
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterWorkers ¶
func RegisterWorkers(conf Config)
RegisterWorkers registers all jobs in the config file as workers
func SetupLogger ¶
SetupLogger sets up a zap logger with default settings
func SetupSugaredLogger ¶
func SetupSugaredLogger() (sugaredLogger *zap.SugaredLogger)
SetupSugaredLogger sets up a zap sugared logger with default settings
Types ¶
type Config ¶
Config is the struct for the config file
func LoadConfig ¶
LoadConfig loads a yaml config file into a Config struct
type Job ¶
type Job struct { Name string `yaml:"name"` Scheme string `yaml:"scheme"` URL string `yaml:"url"` Interval int `yaml:"interval"` Timeout int `yaml:"timeout"` Headers []JobHeaders `yaml:"headers"` Method string `yaml:"method"` Expect JobExpect `yaml:"expect"` }
Job is the struct for a job in the config file
type JobExpect ¶
type JobExpect struct { Status int `yaml:"status"` Body string `yaml:"body"` Contains []string `yaml:"contains"` }
JobExpect is the struct for the expect in a job
type JobHeaders ¶
JobHeaders is the struct for the headers in a job
Click to show internal directories.
Click to hide internal directories.