Versions in this module Expand all Collapse all v0 v0.5.1 Apr 22, 2019 Changes in this version + const ErrorClosedConnection + const ErrorInvalidChannelName + const ErrorInvalidJobID + const ErrorJobHasExpired + const ErrorNewConnection + const JobStatusActive + const JobStatusInactive + type Client interface + AddJob func(channel string, runAt time.Time, args map[string]interface{}) (string, error) + Close func() + Listen func(channel string, f ClientCallbackFunc) error + RemoveJob func(channel, id string) error + func NewClient(config ClientConfig) (Client, error) + type ClientCallbackFunc func(job *Job) error + type ClientConfig struct + Address string + LogLvl LogLevel + Logger logger + ReadDeadline time.Duration + WriteDeadline time.Duration + type Delegator interface + OnIOError func(index int) + OnJobReceived func(data []byte) + OnRequestReceived func(index int, data []byte, addr string) + type Job struct + Args map[string]interface{} + Channel string + ID string + RunAt time.Time + Status int + type JobBatch struct + Jobs []*Job + RunAt time.Time + type LogLevel int + const LogLevelDebug + const LogLevelError + const LogLevelInfo + const LogLevelWarning + func (lvl LogLevel) String() string + type Protocol struct + func (p *Protocol) Close() + func (p *Protocol) Flush() error + func (p *Protocol) Read(d []byte) (int, error) + func (p *Protocol) SetLogger(l logger, lvl LogLevel) + func (p *Protocol) Write(d []byte) (int, error) + func (p *Protocol) WriteCommand(cmd *command.Command) error + type ProtocolConfig struct + Conn net.Conn + Delegator Delegator + Index int + ReadDeadline time.Duration + WriteDeadline time.Duration + type Scheduler interface + Stop func() + func NewScheduler(config SchedulerConfig) (Scheduler, error) + type SchedulerConfig struct + Address string + LogLvl LogLevel + Logger logger + ReadDeadline time.Duration + Storage Storage + WriteDeadline time.Duration + type Storage interface + GetActiveJobs func() (jobs []*Job, err error) + InsertJob func(job *Job) error + RemoveJob func(channel, id string) error