Documentation
¶
Index ¶
- type ProfileType
- type Task
- type TaskManager
- func (s *TaskManager) FindLockFirstCallerName(callerName string) (t *Task, err error)
- func (s *TaskManager) FindTask(id string) (t *Task, err error)
- func (s *TaskManager) NewTask(callerName string, profile ProfileType, status string) (t *Task)
- func (s *TaskManager) SaveTask(t *Task) (*Task, error)
- func (s *TaskManager) UnLockTask(id string) (t *Task, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProfileType ¶
type ProfileType string
ProfileType - indicator of the purpose of the task to be performed
const ( //TaskLeaseProcurement -- TaskLeaseProcurement ProfileType = "lease_procurement" //TaskLeaseReStock -- TaskLeaseReStock ProfileType = "lease_restock" //TaskInventoryLedger -- TaskInventoryLedger ProfileType = "inventory_ledger" //TaskLongPollQueue -- TaskLongPollQueue ProfileType = "longpoll_queue" //TaskActionMetaName -- TaskActionMetaName = "task_action" )
type Task ¶
type Task struct { ID bson.ObjectId `bson:"_id"` Timestamp time.Time `bson:"timestamp"` Status string `bson:"status"` Profile ProfileType `bson:"profile"` CallerName string `bson:"caller_name"` MetaData map[string]interface{} `bson:"metadata"` }
Task - a task object
type TaskManager ¶
type TaskManager struct {
// contains filtered or unexported fields
}
TaskManager - manages task interactions crud stuff
func NewTaskManager ¶
func NewTaskManager(taskCollection integrations.Collection) (tm *TaskManager)
NewTaskManager - this creates a new task manager object and returns it
func (*TaskManager) FindLockFirstCallerName ¶
func (s *TaskManager) FindLockFirstCallerName(callerName string) (t *Task, err error)
FindLockFirstCallerName - find and lock the first matching task, then return it
func (*TaskManager) FindTask ¶
func (s *TaskManager) FindTask(id string) (t *Task, err error)
FindTask - this will find and return a task with a given ID
func (*TaskManager) NewTask ¶
func (s *TaskManager) NewTask(callerName string, profile ProfileType, status string) (t *Task)
NewTask - get us a new empty task
func (*TaskManager) SaveTask ¶
func (s *TaskManager) SaveTask(t *Task) (*Task, error)
SaveTask - saves the given task
func (*TaskManager) UnLockTask ¶
func (s *TaskManager) UnLockTask(id string) (t *Task, err error)
UnLockTask - this will unlock a task with given id
Click to show internal directories.
Click to hide internal directories.