Documentation ¶
Index ¶
- Variables
- type JobRecord
- func (*JobRecord) Descriptor() ([]byte, []int)deprecated
- func (x *JobRecord) GetExpirationTimestamp() int64
- func (x *JobRecord) GetMetadata() map[string]string
- func (x *JobRecord) GetPayload() *anypb.Any
- func (x *JobRecord) GetRepeats() int32
- func (x *JobRecord) GetRhythm() string
- func (x *JobRecord) GetStartTimestamp() int64
- func (x *JobRecord) GetStatus() JobStatus
- func (*JobRecord) ProtoMessage()
- func (x *JobRecord) ProtoReflect() protoreflect.Message
- func (x *JobRecord) Reset()
- func (x *JobRecord) String() string
- type JobStatus
- type JobStore
Constants ¶
This section is empty.
Variables ¶
View Source
var ( JobStatus_name = map[int32]string{ 0: "ACTIVE", 1: "DELETED", } JobStatus_value = map[string]int32{ "ACTIVE": 0, "DELETED": 1, } )
Enum value maps for JobStatus.
View Source
var File_proto_storage_job_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type JobRecord ¶
type JobRecord struct { Status JobStatus `protobuf:"varint,1,opt,name=status,proto3,enum=storage.JobStatus" json:"status,omitempty"` Rhythm string `protobuf:"bytes,2,opt,name=rhythm,proto3" json:"rhythm,omitempty"` StartTimestamp int64 `protobuf:"varint,3,opt,name=startTimestamp,proto3" json:"startTimestamp,omitempty"` // time that the schedule start ExpirationTimestamp int64 `protobuf:"varint,4,opt,name=expirationTimestamp,proto3" json:"expirationTimestamp,omitempty"` // time that the job expires Repeats int32 `protobuf:"varint,5,opt,name=repeats,proto3" json:"repeats,omitempty"` // total number of times the job should trigger Metadata map[string]string `` /* 157-byte string literal not displayed */ Payload *anypb.Any `protobuf:"bytes,7,opt,name=payload,proto3" json:"payload,omitempty"` // contains filtered or unexported fields }
JobRecord is the record persisted as value in Etcd (not the key). Namespace is handled by prefixing the key in the database.
func (*JobRecord) Descriptor
deprecated
func (*JobRecord) GetExpirationTimestamp ¶
func (*JobRecord) GetMetadata ¶
func (*JobRecord) GetPayload ¶
func (*JobRecord) GetRepeats ¶
func (*JobRecord) GetStartTimestamp ¶
func (*JobRecord) ProtoMessage ¶
func (*JobRecord) ProtoMessage()
func (*JobRecord) ProtoReflect ¶
func (x *JobRecord) ProtoReflect() protoreflect.Message
type JobStatus ¶
type JobStatus int32
JobStatus to keep track of jobs to be deleted.
func (JobStatus) Descriptor ¶
func (JobStatus) Descriptor() protoreflect.EnumDescriptor
func (JobStatus) EnumDescriptor
deprecated
func (JobStatus) Number ¶
func (x JobStatus) Number() protoreflect.EnumNumber
func (JobStatus) Type ¶
func (JobStatus) Type() protoreflect.EnumType
type JobStore ¶
type JobStore interface { Start(ctx context.Context) error Put(ctx context.Context, jobName string, job *JobRecord) error Delete(ctx context.Context, jobName string) error Wait() }
The JobStore persists and reads jobs from Etcd.
func NewEtcdJobStore ¶
func NewEtcdJobStore( client *etcdclient.Client, organizer partitioning.Organizer, partitioning partitioning.Partitioner, putCallback func(context.Context, string, *JobRecord) error, deleteCallback func(context.Context, string) error) JobStore
Click to show internal directories.
Click to hide internal directories.