Documentation ¶
Index ¶
- Constants
- Variables
- type Job
- func (job Job) AddToJobQueue() (string, error)
- func (b *Job) GetObjectID() primitive.ObjectID
- func (job *Job) GetOne(c context.Context) error
- func (job Job) Notify() (string, error)
- func (job *Job) ProcessJob(ctx context.Context) error
- func (b *Job) SetStatus(status string) error
- func (job *Job) Store(c context.Context) error
- func (job *Job) Update(c context.Context) error
- func (b *Job) Validate() error
- type Option
Constants ¶
View Source
const ( WORKER_JOB = "job" WORKER_EMAIL = "email" )
View Source
const JOB_STATUS_DONE = "DONE"
View Source
const JOB_STATUS_PENDING = "PENDING"
View Source
const JOB_STATUS_PROCESSING = "PROCESSING"
View Source
const JOB_TYPE_IMPORT_USERS = "IMPORT_USERS"
Variables ¶
View Source
var JOB_STATUS map[string]string = map[string]string{ JOB_STATUS_PENDING: JOB_STATUS_PENDING, JOB_STATUS_PROCESSING: JOB_STATUS_PROCESSING, JOB_STATUS_DONE: JOB_STATUS_DONE, }
View Source
var JobRequests = make(chan Job)
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct { ID string `bson:"_id,omitempty" json:"id,omitempty"` Type string `bson:"type" json:"type" validate:"required"` Status string `bson:"status" json:"status" validate:"required"` InitiatedBy string `bson:"initiated_by" json:"initiated_by" validate:"required"` SourceFile string `bson:"source_file" json:"source_file"` Created string `bson:"created" json:"created"` Modified string `bson:"modified" json:"modified"` }
func CreateNewJob ¶
func (Job) AddToJobQueue ¶
func (*Job) GetObjectID ¶
Click to show internal directories.
Click to hide internal directories.