Documentation ¶
Overview ¶
Package v1 contains the protocol for working with jobs and queues.
Index ¶
- Constants
- Variables
- func AckFromProto(msg *Ack) *resource.Ack
- func HasStatus(job *Job, statuses []Status) bool
- func IsComplete(status Status) bool
- func JobStatusFromProto(status Status) *resource.Status
- func JobStatusesFromProto(statuses []Status) []*resource.Status
- func MarshalJob(jb *resource.Job) ([]byte, error)
- func MarshalQueue(q *resource.Queue) ([]byte, error)
- func NewID() string
- func NewJobFromProto(msg *Job, claims label.Claims) *resource.Job
- func NewJobsFromProto(msgs []*Job) ([]*resource.Job, error)
- func NewQueueFromProto(msg *Queue) *resource.Queue
- func NewQueuesFromProto(msgs []*Queue) []*resource.Queue
- func ParseSchema(q *Queue) (*schema.Schema, error)
- func UnmarshalJob(b []byte, qmsg *Job) (*resource.Job, error)
- func UnmarshalQueue(b []byte, qmsg *Queue) (*resource.Queue, error)
- type Ack
- func (*Ack) Descriptor() ([]byte, []int)deprecated
- func (x *Ack) GetData() []byte
- func (x *Ack) GetError() string
- func (x *Ack) GetId() string
- func (x *Ack) GetStatus() Status
- func (*Ack) ProtoMessage()
- func (x *Ack) ProtoReflect() protoreflect.Message
- func (x *Ack) Reset()
- func (x *Ack) String() string
- type Acks
- type Backoff
- func (*Backoff) Descriptor() ([]byte, []int)deprecated
- func (x *Backoff) GetFactor() float32
- func (x *Backoff) GetInitial() *duration.Duration
- func (x *Backoff) GetMax() *duration.Duration
- func (*Backoff) ProtoMessage()
- func (x *Backoff) ProtoReflect() protoreflect.Message
- func (x *Backoff) Reset()
- func (x *Backoff) String() string
- type Checkin
- type Data
- type Job
- func (*Job) Descriptor() ([]byte, []int)deprecated
- func (x *Job) GetArgs() []byte
- func (x *Job) GetAttempt() int32
- func (x *Job) GetCheckins() []*Checkin
- func (x *Job) GetData() *Data
- func (x *Job) GetDuration() *duration.Duration
- func (x *Job) GetEnqueuedAt() *timestamp.Timestamp
- func (x *Job) GetId() string
- func (x *Job) GetName() string
- func (x *Job) GetQueueV() int32
- func (x *Job) GetResults() []*Result
- func (x *Job) GetStatus() Status
- func (x *Job) GetV() int32
- func (*Job) ProtoMessage()
- func (x *Job) ProtoReflect() protoreflect.Message
- func (x *Job) Reset()
- func (x *Job) String() string
- type JobListParams
- func (*JobListParams) Descriptor() ([]byte, []int)deprecated
- func (x *JobListParams) GetCreatedSince() *timestamp.Timestamp
- func (x *JobListParams) GetCreatedUntil() *timestamp.Timestamp
- func (x *JobListParams) GetNames() []string
- func (x *JobListParams) GetSelectors() []string
- func (x *JobListParams) GetStatuses() []Status
- func (*JobListParams) ProtoMessage()
- func (x *JobListParams) ProtoReflect() protoreflect.Message
- func (x *JobListParams) Reset()
- func (x *JobListParams) String() string
- type Jobs
- type Queue
- func (*Queue) Descriptor() ([]byte, []int)deprecated
- func (x *Queue) GetBackoffFactor() float32
- func (x *Queue) GetBackoffInitialDuration() *duration.Duration
- func (x *Queue) GetBackoffMaxDuration() *duration.Duration
- func (x *Queue) GetBlocked() bool
- func (x *Queue) GetCheckinDuration() *duration.Duration
- func (x *Queue) GetClaimDuration() *duration.Duration
- func (x *Queue) GetCreatedAt() *timestamp.Timestamp
- func (x *Queue) GetDeletedAt() *timestamp.Timestamp
- func (x *Queue) GetDuration() *duration.Duration
- func (x *Queue) GetId() string
- func (x *Queue) GetLabels() map[string]string
- func (x *Queue) GetPaused() bool
- func (x *Queue) GetRetries() int32
- func (x *Queue) GetSchema() []byte
- func (x *Queue) GetUnique() bool
- func (x *Queue) GetUnpaused() bool
- func (x *Queue) GetUpdatedAt() *timestamp.Timestamp
- func (x *Queue) GetV() int32
- func (*Queue) ProtoMessage()
- func (x *Queue) ProtoReflect() protoreflect.Message
- func (x *Queue) Reset()
- func (x *Queue) String() string
- type QueueListParams
- func (*QueueListParams) Descriptor() ([]byte, []int)deprecated
- func (x *QueueListParams) GetNames() []string
- func (x *QueueListParams) GetSelectors() []string
- func (*QueueListParams) ProtoMessage()
- func (x *QueueListParams) ProtoReflect() protoreflect.Message
- func (x *QueueListParams) Reset()
- func (x *QueueListParams) String() string
- type Queues
- type Result
- func (*Result) Descriptor() ([]byte, []int)deprecated
- func (x *Result) GetAttempt() int32
- func (x *Result) GetCompletedAt() *timestamp.Timestamp
- func (x *Result) GetData() []byte
- func (x *Result) GetStartedAt() *timestamp.Timestamp
- func (x *Result) GetStatus() Status
- func (*Result) ProtoMessage()
- func (x *Result) ProtoReflect() protoreflect.Message
- func (x *Result) Reset()
- func (x *Result) String() string
- type Status
Constants ¶
View Source
const ( StatusUnknown = Status_STATUS_UNSPECIFIED StatusQueued = Status_STATUS_QUEUED StatusRunning = Status_STATUS_RUNNING StatusComplete = Status_STATUS_COMPLETE StatusDead = Status_STATUS_DEAD StatusCancelled = Status_STATUS_CANCELLED StatusInvalid = Status_STATUS_INVALID StatusFailed = Status_STATUS_FAILED )
Variables ¶
View Source
var ( Status_name = map[int32]string{ 0: "STATUS_UNSPECIFIED", 1: "STATUS_QUEUED", 2: "STATUS_RUNNING", 3: "STATUS_COMPLETE", 4: "STATUS_DEAD", 5: "STATUS_CANCELLED", 6: "STATUS_INVALID", 7: "STATUS_FAILED", } Status_value = map[string]int32{ "STATUS_UNSPECIFIED": 0, "STATUS_QUEUED": 1, "STATUS_RUNNING": 2, "STATUS_COMPLETE": 3, "STATUS_DEAD": 4, "STATUS_CANCELLED": 5, "STATUS_INVALID": 6, "STATUS_FAILED": 7, } )
Enum value maps for Status.
View Source
var File_job_v1_ack_proto protoreflect.FileDescriptor
View Source
var File_job_v1_backoff_proto protoreflect.FileDescriptor
View Source
var File_job_v1_checkin_proto protoreflect.FileDescriptor
View Source
var File_job_v1_data_proto protoreflect.FileDescriptor
View Source
var File_job_v1_job_proto protoreflect.FileDescriptor
View Source
var File_job_v1_queue_proto protoreflect.FileDescriptor
View Source
var File_job_v1_result_proto protoreflect.FileDescriptor
View Source
var File_job_v1_status_proto protoreflect.FileDescriptor
Functions ¶
func AckFromProto ¶
func IsComplete ¶
func JobStatusFromProto ¶
func JobStatusesFromProto ¶
func NewQueueFromProto ¶
func NewQueuesFromProto ¶
Types ¶
type Ack ¶
type Ack struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=job.v1.Status" json:"status,omitempty"` Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
func (*Ack) Descriptor
deprecated
func (*Ack) ProtoMessage ¶
func (*Ack) ProtoMessage()
func (*Ack) ProtoReflect ¶
func (x *Ack) ProtoReflect() protoreflect.Message
type Acks ¶
type Acks struct { Acks []*Ack `protobuf:"bytes,1,rep,name=acks,proto3" json:"acks,omitempty"` // contains filtered or unexported fields }
func (*Acks) Descriptor
deprecated
func (*Acks) ProtoMessage ¶
func (*Acks) ProtoMessage()
func (*Acks) ProtoReflect ¶
func (x *Acks) ProtoReflect() protoreflect.Message
type Backoff ¶
type Backoff struct { Initial *duration.Duration `protobuf:"bytes,1,opt,name=initial,proto3" json:"initial,omitempty"` Max *duration.Duration `protobuf:"bytes,2,opt,name=max,proto3" json:"max,omitempty"` Factor float32 `protobuf:"fixed32,3,opt,name=factor,proto3" json:"factor,omitempty"` // contains filtered or unexported fields }
func (*Backoff) Descriptor
deprecated
func (*Backoff) GetInitial ¶
func (*Backoff) ProtoMessage ¶
func (*Backoff) ProtoMessage()
func (*Backoff) ProtoReflect ¶
func (x *Backoff) ProtoReflect() protoreflect.Message
type Checkin ¶
type Checkin struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` CreatedAt *timestamp.Timestamp `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // contains filtered or unexported fields }
func (*Checkin) Descriptor
deprecated
func (*Checkin) GetCreatedAt ¶
func (*Checkin) ProtoMessage ¶
func (*Checkin) ProtoMessage()
func (*Checkin) ProtoReflect ¶
func (x *Checkin) ProtoReflect() protoreflect.Message
type Data ¶
type Data struct { Claims []string `protobuf:"bytes,1,rep,name=claims,proto3" json:"claims,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*Data) Descriptor
deprecated
func (*Data) ProtoMessage ¶
func (*Data) ProtoMessage()
func (*Data) ProtoReflect ¶
func (x *Data) ProtoReflect() protoreflect.Message
type Job ¶
type Job struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` V int32 `protobuf:"varint,2,opt,name=v,proto3" json:"v,omitempty"` QueueV int32 `protobuf:"varint,3,opt,name=queue_v,json=queueV,proto3" json:"queue_v,omitempty"` Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` Args []byte `protobuf:"bytes,5,opt,name=args,proto3" json:"args,omitempty"` Data *Data `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"` Attempt int32 `protobuf:"varint,7,opt,name=attempt,proto3" json:"attempt,omitempty"` Duration *duration.Duration `protobuf:"bytes,8,opt,name=duration,proto3" json:"duration,omitempty"` Status Status `protobuf:"varint,9,opt,name=status,proto3,enum=job.v1.Status" json:"status,omitempty"` Checkins []*Checkin `protobuf:"bytes,10,rep,name=checkins,proto3" json:"checkins,omitempty"` Results []*Result `protobuf:"bytes,11,rep,name=results,proto3" json:"results,omitempty"` EnqueuedAt *timestamp.Timestamp `protobuf:"bytes,12,opt,name=enqueued_at,json=enqueuedAt,proto3" json:"enqueued_at,omitempty"` // contains filtered or unexported fields }
func (*Job) Descriptor
deprecated
func (*Job) GetAttempt ¶
func (*Job) GetCheckins ¶
func (*Job) GetDuration ¶
func (*Job) GetEnqueuedAt ¶
func (*Job) GetResults ¶
func (*Job) ProtoMessage ¶
func (*Job) ProtoMessage()
func (*Job) ProtoReflect ¶
func (x *Job) ProtoReflect() protoreflect.Message
type JobListParams ¶
type JobListParams struct { Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"` Statuses []Status `protobuf:"varint,2,rep,packed,name=statuses,proto3,enum=job.v1.Status" json:"statuses,omitempty"` Selectors []string `protobuf:"bytes,3,rep,name=selectors,proto3" json:"selectors,omitempty"` CreatedSince *timestamp.Timestamp `protobuf:"bytes,4,opt,name=created_since,json=createdSince,proto3" json:"created_since,omitempty"` CreatedUntil *timestamp.Timestamp `protobuf:"bytes,5,opt,name=created_until,json=createdUntil,proto3" json:"created_until,omitempty"` // contains filtered or unexported fields }
func (*JobListParams) Descriptor
deprecated
func (*JobListParams) Descriptor() ([]byte, []int)
Deprecated: Use JobListParams.ProtoReflect.Descriptor instead.
func (*JobListParams) GetCreatedSince ¶
func (x *JobListParams) GetCreatedSince() *timestamp.Timestamp
func (*JobListParams) GetCreatedUntil ¶
func (x *JobListParams) GetCreatedUntil() *timestamp.Timestamp
func (*JobListParams) GetNames ¶
func (x *JobListParams) GetNames() []string
func (*JobListParams) GetSelectors ¶
func (x *JobListParams) GetSelectors() []string
func (*JobListParams) GetStatuses ¶
func (x *JobListParams) GetStatuses() []Status
func (*JobListParams) ProtoMessage ¶
func (*JobListParams) ProtoMessage()
func (*JobListParams) ProtoReflect ¶
func (x *JobListParams) ProtoReflect() protoreflect.Message
func (*JobListParams) Reset ¶
func (x *JobListParams) Reset()
func (*JobListParams) String ¶
func (x *JobListParams) String() string
type Jobs ¶
type Jobs struct { Jobs []*Job `protobuf:"bytes,1,rep,name=jobs,proto3" json:"jobs,omitempty"` // contains filtered or unexported fields }
func (*Jobs) Descriptor
deprecated
func (*Jobs) ProtoMessage ¶
func (*Jobs) ProtoMessage()
func (*Jobs) ProtoReflect ¶
func (x *Jobs) ProtoReflect() protoreflect.Message
type Queue ¶
type Queue struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` V int32 `protobuf:"varint,2,opt,name=v,proto3" json:"v,omitempty"` Retries int32 `protobuf:"varint,3,opt,name=retries,proto3" json:"retries,omitempty"` Duration *duration.Duration `protobuf:"bytes,4,opt,name=duration,proto3" json:"duration,omitempty"` ClaimDuration *duration.Duration `protobuf:"bytes,5,opt,name=claim_duration,json=claimDuration,proto3" json:"claim_duration,omitempty"` CheckinDuration *duration.Duration `protobuf:"bytes,6,opt,name=checkin_duration,json=checkinDuration,proto3" json:"checkin_duration,omitempty"` Labels map[string]string `` /* 153-byte string literal not displayed */ Schema []byte `protobuf:"bytes,8,opt,name=schema,proto3" json:"schema,omitempty"` Unique bool `protobuf:"varint,9,opt,name=unique,proto3" json:"unique,omitempty"` BackoffInitialDuration *duration.Duration `` /* 130-byte string literal not displayed */ BackoffMaxDuration *duration.Duration `protobuf:"bytes,11,opt,name=backoff_max_duration,json=backoffMaxDuration,proto3" json:"backoff_max_duration,omitempty"` BackoffFactor float32 `protobuf:"fixed32,12,opt,name=backoff_factor,json=backoffFactor,proto3" json:"backoff_factor,omitempty"` Paused bool `protobuf:"varint,13,opt,name=paused,proto3" json:"paused,omitempty"` Unpaused bool `protobuf:"varint,14,opt,name=unpaused,proto3" json:"unpaused,omitempty"` Blocked bool `protobuf:"varint,15,opt,name=blocked,proto3" json:"blocked,omitempty"` CreatedAt *timestamp.Timestamp `protobuf:"bytes,16,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` UpdatedAt *timestamp.Timestamp `protobuf:"bytes,17,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` DeletedAt *timestamp.Timestamp `protobuf:"bytes,18,opt,name=deleted_at,json=deletedAt,proto3" json:"deleted_at,omitempty"` // contains filtered or unexported fields }
func NewQueueFromResource ¶
func NewQueuesFromResources ¶
func (*Queue) Descriptor
deprecated
func (*Queue) GetBackoffFactor ¶
func (*Queue) GetBackoffInitialDuration ¶
func (*Queue) GetBackoffMaxDuration ¶
func (*Queue) GetBlocked ¶ added in v0.4.0
func (*Queue) GetCheckinDuration ¶
func (*Queue) GetClaimDuration ¶
func (*Queue) GetCreatedAt ¶
func (*Queue) GetDeletedAt ¶
func (*Queue) GetDuration ¶
func (*Queue) GetRetries ¶
func (*Queue) GetUnpaused ¶ added in v0.4.0
func (*Queue) GetUpdatedAt ¶
func (*Queue) ProtoMessage ¶
func (*Queue) ProtoMessage()
func (*Queue) ProtoReflect ¶
func (x *Queue) ProtoReflect() protoreflect.Message
type QueueListParams ¶
type QueueListParams struct { Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"` Selectors []string `protobuf:"bytes,2,rep,name=selectors,proto3" json:"selectors,omitempty"` // contains filtered or unexported fields }
func (*QueueListParams) Descriptor
deprecated
func (*QueueListParams) Descriptor() ([]byte, []int)
Deprecated: Use QueueListParams.ProtoReflect.Descriptor instead.
func (*QueueListParams) GetNames ¶
func (x *QueueListParams) GetNames() []string
func (*QueueListParams) GetSelectors ¶
func (x *QueueListParams) GetSelectors() []string
func (*QueueListParams) ProtoMessage ¶
func (*QueueListParams) ProtoMessage()
func (*QueueListParams) ProtoReflect ¶
func (x *QueueListParams) ProtoReflect() protoreflect.Message
func (*QueueListParams) Reset ¶
func (x *QueueListParams) Reset()
func (*QueueListParams) String ¶
func (x *QueueListParams) String() string
type Queues ¶
type Queues struct { Queues []*Queue `protobuf:"bytes,1,rep,name=queues,proto3" json:"queues,omitempty"` // contains filtered or unexported fields }
func (*Queues) Descriptor
deprecated
func (*Queues) ProtoMessage ¶
func (*Queues) ProtoMessage()
func (*Queues) ProtoReflect ¶
func (x *Queues) ProtoReflect() protoreflect.Message
type Result ¶
type Result struct { Attempt int32 `protobuf:"varint,1,opt,name=attempt,proto3" json:"attempt,omitempty"` Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=job.v1.Status" json:"status,omitempty"` Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` StartedAt *timestamp.Timestamp `protobuf:"bytes,4,opt,name=started_at,json=startedAt,proto3" json:"started_at,omitempty"` CompletedAt *timestamp.Timestamp `protobuf:"bytes,5,opt,name=completed_at,json=completedAt,proto3" json:"completed_at,omitempty"` // contains filtered or unexported fields }
func (*Result) Descriptor
deprecated
func (*Result) GetAttempt ¶
func (*Result) GetCompletedAt ¶
func (*Result) GetStartedAt ¶
func (*Result) ProtoMessage ¶
func (*Result) ProtoMessage()
func (*Result) ProtoReflect ¶
func (x *Result) ProtoReflect() protoreflect.Message
type Status ¶
type Status int32
func JobStatusToProto ¶
func (Status) Descriptor ¶
func (Status) Descriptor() protoreflect.EnumDescriptor
func (Status) EnumDescriptor
deprecated
func (Status) Number ¶
func (x Status) Number() protoreflect.EnumNumber
func (Status) Type ¶
func (Status) Type() protoreflect.EnumType
Click to show internal directories.
Click to hide internal directories.