Documentation
¶
Index ¶
- Variables
- type Schedule
- type ScheduleImpl
- func (s *ScheduleImpl) Add(ctx context.Context, task *Task, interval time.Duration, ...) error
- func (s *ScheduleImpl) Exists(ctx context.Context, kind string, id string) (bool, error)
- func (s *ScheduleImpl) On(ctx context.Context, kind string, ...) error
- func (s *ScheduleImpl) Remove(ctx context.Context, kind string, id string) error
- func (s *ScheduleImpl) RunNow(ctx context.Context, kind string, id string) error
- type Task
- type TaskData
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnexpectedReturnCode = errors.New("unexpected return code from redis") ErrUnexpectedReturnCodeType = errors.New("unexpected return code type from redis, expected integer") ErrTaskAlreadyExists = errors.New("task already exists") ErrTaskDoesNotExist = errors.New("task does not exist") ErrTaskDataDoesNotExist = errors.New("task data does not exist") ErrTaskDataInvalidFormat = errors.New("task data has invalid format, expected JSON") ErrIntervalTooSmall = errors.New("interval must be at least 1 millisecond") )
Functions ¶
This section is empty.
Types ¶
type Schedule ¶
type Schedule interface { Add(ctx context.Context, task *Task, interval time.Duration, firstExecution time.Time) error Remove(ctx context.Context, kind string, id string) error Exists(ctx context.Context, kind string, id string) (bool, error) RunNow(ctx context.Context, kind string, id string) error On(ctx context.Context, kind string, handler func(ctx context.Context, task *Task)) error }
func NewSchedule ¶
func NewSchedule(redisClient *redis.Client) Schedule
type ScheduleImpl ¶
type ScheduleImpl struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.