Documentation ¶
Index ¶
- type DB
- func (db *DB) AcquireTask(workerName string) (*Task, error)
- func (db *DB) DeleteTask(t *Task) error
- func (db *DB) EmptyTask() Task
- func (db *DB) GetTask(index string, args ...interface{}) (*Task, error)
- func (db *DB) GetTasks(ch chan *Task, index string, args ...interface{}) error
- func (db *DB) GetTasksBetweenState(ch chan *Task, stateStart int, stateEnd int) error
- func (db *DB) InsertTasks(tasks []*Task) error
- func (db *DB) ReadSnapshot(path string) error
- func (db *DB) UpdateTask(t *Task, state int, status string) error
- func (db *DB) WriteSnapshot(path string) error
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) DeleteTask ¶
func (*DB) GetTasksBetweenState ¶
func (*DB) InsertTasks ¶
func (*DB) ReadSnapshot ¶
func (*DB) WriteSnapshot ¶
type Task ¶
type Task struct { Id string `json:"id"` Sticker string `json:"sticker"` Priority int `json:"priority"` Body string `json:"body"` Pool string `json:"pool"` State int `json:"state"` // 0:NEW, 1:ACQUIRED, 2:WORK, 3:DONE, 4:ERROR Status string `json:"status,omitempty"` Worker string `json:"worker,omitempty"` Added uint64 `json:"added"` Updated uint64 `json:"updated"` }
Click to show internal directories.
Click to hide internal directories.