Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHandlerFunc ¶
func NewHandlerFunc(target Target) func()
NewHandlerFunc creates a new handler function based on the target in the Handler struct. This function calls the target and loads the data into the database through the core API.
Types ¶
type Daemon ¶
type Daemon struct {
Targets []Target
}
Daemon is the primary API that the user uses to add targets and run call cycles on a continuous basis.
type Directive ¶
type Directive struct { Prefix string Configuration *core.Configuration Warehouse core.Warehouse }
Directive defines where data from a target should go according to a provided configuration and database.
type Schedule ¶
type Schedule struct { Type ScheduleType Window uint64 }
Schedule defines a call cycle schedule configuration to be consumed by the gocron API, returned by Target.Schedule.
type ScheduleType ¶
type ScheduleType int
ScheduleType abstracts the available window type constants for call cycle scheduling.
const ( Second ScheduleType = iota Minute Hour Day Week )
Minute, Hour, Day, and Week constants are used by the daemon to determine how to schedule calls with the gocron API.
type Target ¶
type Target interface { Label() string Flag() string Schedule() (*Schedule, error) Directive() (*Directive, error) Call() ([]utils.Header, [][]interface{}, error) }
Target is the interface that user-defined data retrieval processes must abide by in order to be successfully consumed by the daemon.