Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct { Id primitive.ObjectID `json:"Id" bson:"_id,omitempty"` Name string `json:"Name" bson:"name" validate:"required,min=3,max=250"` Description string `json:"Description" bson:"description" validate:"required,min=3,max=500"` ScheduleTime time.Time `json:"ScheduleTime" bson:"scheduleTime"` CreatedAt time.Time `json:"CreatedAt" bson:"createdAt"` UpdatedAt time.Time `json:"UpdatedAt" bson:"updatedAt"` Status int32 `json:"Status" bson:"status"` JobType int32 `json:"JobType" bson:"jobType"` JobData string `json:"JobData" bson:"jobData"` ScheduledKey int `json:"ScheduledKey" bson:"scheduledKey"` }
func JobFromProto_CreateJobRequest ¶
func JobFromProto_CreateJobRequest(jbr *proto.CreateJobRequest) (*Job, error)
func JobFromProto_Job ¶
Note: 0 values for int and empty strings will be ignored proto.
func JobFromProto_UpdateJobRequest ¶
func JobFromProto_UpdateJobRequest(jbr *proto.UpdateJobRequest) (*Job, error)
type JobDB ¶
type JobDB interface { Create(ctx context.Context, job *Job) (*Job, error) Update(ctx context.Context, job *Job) (*Job, error) GetByID(ctx context.Context, jobID string) (*Job, error) DeleteByID(ctx context.Context, jobID string) error GetByScheduledKey(ctx context.Context, jobScheduledKey int) (*Job, error) DeleteByScheduledKey(ctx context.Context, jobScheduledKey int) error ListALL(ctx context.Context, page int64, size int64) (*JobsList, error) }
databas interface for Job model
type JobsList ¶
type JobsList struct { TotalCount int64 `json:"totalCount"` TotalPages int64 `json:"totalPages"` Page int64 `json:"page"` Size int64 `json:"size"` HasMore bool `json:"hasMore"` Jobs []*Job `json:"jobs"` }
func (*JobsList) ToProto ¶
func (j *JobsList) ToProto() *proto.ListJobsResponse
Click to show internal directories.
Click to hide internal directories.