Documentation ¶
Index ¶
- Constants
- Variables
- type ProfileType
- type RedactedTask
- type Task
- type TaskManager
- func (s *TaskManager) FindAndStallTaskForCaller(callerName string) (task *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)
Constants ¶
const ( //TaskLeaseProcurement -- TaskLeaseProcurement ProfileType = "lease_procurement" //TaskLeaseReStock -- TaskLeaseReStock ProfileType = "lease_restock" //TaskInventoryLedger -- TaskInventoryLedger ProfileType = "inventory_ledger" //TaskLongPollQueue -- TaskLongPollQueue ProfileType = "longpoll_queue" //TaskChildID -- child task spawned from current task TaskChildID = "child_task_id" //TaskActionMetaName -- TaskActionMetaName = "task_action" //ExpiredTask - ExpiredTask int64 = 0 //TaskStatusAvailable --- task status is set to available TaskStatusAvailable = "available" )
Variables ¶
var ( //ErrNoResults - no results found in query ErrNoResults = errors.New("no results found") )
Functions ¶
This section is empty.
Types ¶
type ProfileType ¶
type ProfileType string
ProfileType - indicator of the purpose of the task to be performed
type RedactedTask ¶ added in v0.0.66
type RedactedTask struct { ID bson.ObjectId `bson:"_id"` Timestamp int64 `bson:"timestamp"` Expires int64 `bson:"expires"` Status string `bson:"status"` Profile ProfileType `bson:"profile"` CallerName string `bson:"caller_name"` MetaData map[string]interface{} `bson:"metadata"` }
RedactedTask - a task object without sensitive information
type Task ¶
type Task struct { ID bson.ObjectId `bson:"_id"` Timestamp int64 `bson:"timestamp"` Expires int64 `bson:"expires"` Status string `bson:"status"` Profile ProfileType `bson:"profile"` CallerName string `bson:"caller_name"` MetaData map[string]interface{} `bson:"metadata"` PrivateMetaData map[string]interface{} `bson:"private_metadata"` }
Task - a task object
func (*Task) GetPrivateMeta ¶ added in v0.0.66
GetPrivateMeta - get a private meta record
func (*Task) GetPublicMeta ¶ added in v0.0.66
GetPublicMeta - get a public metadata record
func (*Task) GetRedactedVersion ¶ added in v0.0.66
func (s *Task) GetRedactedVersion() RedactedTask
GetRedactedVersion - returns a redacted version of this task, removing private info
func (*Task) SetPrivateMeta ¶ added in v0.0.66
SetPrivateMeta - set a private meta data record
func (*Task) SetPublicMeta ¶ added in v0.0.66
SetPublicMeta - set a public metadata record
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) FindAndStallTaskForCaller ¶ added in v0.0.64
func (s *TaskManager) FindAndStallTaskForCaller(callerName string) (task *Task, err error)
FindAndStallTaskForCaller - 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