Documentation ¶
Index ¶
- Constants
- Variables
- type Scheduler
- func (s *Scheduler) Run(req TaskRequest) error
- func (s *Scheduler) SetLogLevel(lvl log.Level)
- func (s *Scheduler) Start()
- func (s *Scheduler) Stop()
- func (s *Scheduler) WithCallback(cb TaskCompletionCallback) *Scheduler
- func (s *Scheduler) WithContext(ctx context.Context) *Scheduler
- func (s *Scheduler) WithLogger(logger log.Logger) *Scheduler
- func (s *Scheduler) WithTable(t *pack.Table) *Scheduler
- type TaskCompletionCallback
- type TaskRequest
- type TaskResult
- type TaskStatus
Constants ¶
View Source
const ( TaskStatusInvalid = iota TaskStatusIdle TaskStatusRunning TaskStatusSuccess TaskStatusFailed TaskStatusTimeout )
View Source
const TaskTableKey = "task"
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
func NewScheduler ¶
func NewScheduler() *Scheduler
func (*Scheduler) Run ¶
func (s *Scheduler) Run(req TaskRequest) error
func (*Scheduler) SetLogLevel ¶
func (*Scheduler) WithCallback ¶
func (s *Scheduler) WithCallback(cb TaskCompletionCallback) *Scheduler
type TaskCompletionCallback ¶
type TaskCompletionCallback func(context.Context, *TaskResult) error
type TaskRequest ¶
type TaskRequest struct { Id uint64 `pack:"I,pk" json:"id"` Index string `pack:"J" json:"index"` Decoder uint64 `pack:"D" json:"decoder"` Owner tezos.Address `pack:"o,bloom=2" json:"owner"` Account uint64 `pack:"a,bloom=2" json:"account"` Ordered bool `pack:"O" json:"ordered"` Flags uint64 `pack:"f,snappy" json:"flags"` Url string `pack:"u,snappy" json:"url"` Status TaskStatus `pack:"s,snappy" json:"status"` Data []byte `pack:"d,snappy" json:"data"` }
func (TaskRequest) ID ¶
func (r TaskRequest) ID() uint64
func (*TaskRequest) SetID ¶
func (r *TaskRequest) SetID(i uint64)
func (TaskRequest) TableKey ¶
func (r TaskRequest) TableKey() string
func (TaskRequest) TableOpts ¶
func (r TaskRequest) TableOpts() pack.Options
type TaskResult ¶
type TaskStatus ¶
type TaskStatus byte
func ParseTaskStatus ¶
func ParseTaskStatus(s string) TaskStatus
func (TaskStatus) IsValid ¶
func (t TaskStatus) IsValid() bool
func (TaskStatus) MarshalText ¶
func (t TaskStatus) MarshalText() ([]byte, error)
func (TaskStatus) String ¶
func (s TaskStatus) String() string
func (*TaskStatus) UnmarshalText ¶
func (t *TaskStatus) UnmarshalText(data []byte) error
Click to show internal directories.
Click to hide internal directories.