Versions in this module Expand all Collapse all v0 v0.1.0 Dec 21, 2023 Changes in this version + const STATUS_PAUSED + const STATUS_RUNNING + const TYPE_CRON + const TYPE_DATETIME + const TYPE_INTERVAL + const Version + var GetClusterNode = (*Scheduler).getClusterNode + var GetStore = (*Scheduler).getStore + func CalcNextRunTime(j Job) (time.Time, error) + func JobToPbJobPtr(j Job) *pb.Job + func JobsToPbJobsPtr(js []Job) *pb.Jobs + func RegisterFuncs(fs ...func(context.Context, Job)) + func StateDump(j Job) ([]byte, error) + type ClusterNode struct + Endpoint string + EndpointHTTP string + Id string + MainEndpoint string + Queue string + Scheduler *Scheduler + SchedulerEndpoint string + func (cn *ClusterNode) NodeMap() map[string]map[string]map[string]any + func (cn *ClusterNode) RPCPing(args *Node, reply *Node) + func (cn *ClusterNode) RPCRegister(args *Node, reply *Node) + func (cn *ClusterNode) RegisterNodeRemote(ctx context.Context) error + type EmailConfig struct + Password string + Port int + Recipients []string + SMTPServer string + Sender string + Username string + type FuncUnregisteredError string + func (e FuncUnregisteredError) Error() string + type HTTPCallbackConfig struct + MentionList []string + MessageType string + URL string + type Job struct + Args map[string]any + CronExpr string + EndAt string + Func func(context.Context, Job) + FuncName string + Id string + Interval string + LastRunTime time.Time + Name string + NextRunTime time.Time + Queues []string + StartAt string + Status string + Timeout string + Timezone string + Type string + func PbJobPtrToJob(pbJob *pb.Job) Job + func PbJobsPtrToJobs(pbJs *pb.Jobs) []Job + func StateLoad(state []byte) (Job, error) + func (j *Job) FullName() string + func (j *Job) LastRunTimeWithTimezone() time.Time + func (j *Job) NextRunTimeWithTimezone() time.Time + func (j Job) String() string + type JobNotFoundError string + func (e JobNotFoundError) Error() string + type JobSlice []Job + func (js JobSlice) Len() int + func (js JobSlice) Less(i, j int) bool + func (js JobSlice) Swap(i, j int) + type JobTimeoutError struct + Err error + FullName string + Timeout string + func (e *JobTimeoutError) Error() string + type Node struct + Endpoint string + EndpointHTTP string + Id string + MainEndpoint string + NodeMap map[string]map[string]map[string]any + Queue string + SchedulerEndpoint string + type Scheduler struct + EmailConfig *EmailConfig + HTTPCallbackConfig *HTTPCallbackConfig + func (s *Scheduler) AddJob(j Job) (Job, error) + func (s *Scheduler) DeleteAllJobs() error + func (s *Scheduler) DeleteJob(id string) error + func (s *Scheduler) GetAllJobs() ([]Job, error) + func (s *Scheduler) GetJob(id string) (Job, error) + func (s *Scheduler) PauseJob(id string) (Job, error) + func (s *Scheduler) ResumeJob(id string) (Job, error) + func (s *Scheduler) RunJob(j Job) error + func (s *Scheduler) ScheduleJob(j Job) error + func (s *Scheduler) SetClusterNode(ctx context.Context, cn *ClusterNode) error + func (s *Scheduler) SetStore(sto Store) error + func (s *Scheduler) Start() + func (s *Scheduler) Stop() + func (s *Scheduler) UpdateJob(j Job) (Job, error) + type Store interface + AddJob func(j Job) error + Clear func() error + DeleteAllJobs func() error + DeleteJob func(id string) error + GetAllJobs func() ([]Job, error) + GetJob func(id string) (Job, error) + GetNextRunTime func() (time.Time, error) + Init func() error + UpdateJob func(j Job) error