api

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2024 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_counter_proto protoreflect.FileDescriptor
View Source
var File_proto_job_proto protoreflect.FileDescriptor
View Source
var File_proto_trigger_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Counter

type Counter struct {

	// job_partition_id is the parition_id of the job this counter belongs to.
	// Prevents an updated job from inheriting the counter of a previous job with
	// the same name.
	// Doesn't need to be globally unique.
	JobPartitionId uint32 `protobuf:"varint,1,opt,name=job_partition_id,json=jobPartitionId,proto3" json:"job_partition_id,omitempty"`
	// count is the number of times the job has been triggered.
	Count uint32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"`
	// last_trigger is the timestamp the job was last triggered. Used to
	// determine the next time the job should be triggered.
	LastTrigger *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=last_trigger,json=lastTrigger,proto3" json:"last_trigger,omitempty"`
	// contains filtered or unexported fields
}

Counter holds counter information for a given job.

func (*Counter) Descriptor deprecated

func (*Counter) Descriptor() ([]byte, []int)

Deprecated: Use Counter.ProtoReflect.Descriptor instead.

func (*Counter) GetCount

func (x *Counter) GetCount() uint32

func (*Counter) GetJobPartitionId

func (x *Counter) GetJobPartitionId() uint32

func (*Counter) GetLastTrigger

func (x *Counter) GetLastTrigger() *timestamppb.Timestamp

func (*Counter) ProtoMessage

func (*Counter) ProtoMessage()

func (*Counter) ProtoReflect

func (x *Counter) ProtoReflect() protoreflect.Message

func (*Counter) Reset

func (x *Counter) Reset()

func (*Counter) String

func (x *Counter) String() string

type Job

type Job struct {

	// schedule is an optional schedule at which the job is to be run.
	// Accepts both systemd timer style cron expressions, as well as human
	// readable '@' prefixed period strings as defined below.
	//
	// Systemd timer style cron accepts 6 fields:
	// seconds | minutes | hours | day of month | month        | day of week
	// 0-59    | 0-59    | 0-23  | 1-31         | 1-12/jan-dec | 0-7/sun-sat
	//
	// "0 30 * * * *" - every hour on the half hour
	// "0 15 3 * * *" - every day at 03:15
	//
	// Period string expressions:
	// Entry                  | Description                                | Equivalent To
	// -----                  | -----------                                | -------------
	// @every <duration>      | Run every <duration> (e.g. '@every 1h30m') | N/A
	// @yearly (or @annually) | Run once a year, midnight, Jan. 1st        | 0 0 0 1 1 *
	// @monthly               | Run once a month, midnight, first of month | 0 0 0 1 * *
	// @weekly                | Run once a week, midnight on Sunday        | 0 0 0 * * 0
	// @daily (or @midnight)  | Run once a day, midnight                   | 0 0 0 * * *
	// @hourly                | Run once an hour, beginning of hour        | 0 0 * * * *
	Schedule *string `protobuf:"bytes,1,opt,name=schedule,proto3,oneof" json:"schedule,omitempty"`
	// due_time is the optional time at which the job should be active, or the
	// "one shot" time if other scheduling type fields are not provided.
	// Accepts a "point in time" string in the format of RFC3339, Go duration
	// string (therefore calculated from now), or non-repeating ISO8601.
	DueTime *string `protobuf:"bytes,2,opt,name=due_time,json=dueTime,proto3,oneof" json:"due_time,omitempty"`
	// ttl is the optional time to live or expiration of the job.
	// Accepts a "point in time" string in the format of RFC3339, Go duration
	// string (therefore calculated from now), or non-repeating ISO8601.
	Ttl *string `protobuf:"bytes,3,opt,name=ttl,proto3,oneof" json:"ttl,omitempty"`
	// repeats is the optional number of times in which the job should be
	// triggered. If not set, the job will run indefinitely or until expiration.
	Repeats *uint32 `protobuf:"varint,4,opt,name=repeats,proto3,oneof" json:"repeats,omitempty"`
	// metadata is a arbitrary metadata asociated with the job.
	Metadata *anypb.Any `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// payload is the serialized job payload that will be sent to the recipient
	// when the job is triggered.
	Payload *anypb.Any `protobuf:"bytes,6,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

Job defines a scheduled rhythmic job stored in the database. Job holds the desired spec of the job, not the current trigger state, held by Counter.

func (*Job) Descriptor deprecated

func (*Job) Descriptor() ([]byte, []int)

Deprecated: Use Job.ProtoReflect.Descriptor instead.

func (*Job) GetDueTime

func (x *Job) GetDueTime() string

func (*Job) GetMetadata

func (x *Job) GetMetadata() *anypb.Any

func (*Job) GetPayload

func (x *Job) GetPayload() *anypb.Any

func (*Job) GetRepeats

func (x *Job) GetRepeats() uint32

func (*Job) GetSchedule

func (x *Job) GetSchedule() string

func (*Job) GetTtl

func (x *Job) GetTtl() string

func (*Job) ProtoMessage

func (*Job) ProtoMessage()

func (*Job) ProtoReflect

func (x *Job) ProtoReflect() protoreflect.Message

func (*Job) Reset

func (x *Job) Reset()

func (*Job) String

func (x *Job) String() string

type JobStored

type JobStored struct {

	// partion_id is an identifier for the job, used for distinguishing jobs with
	// the same name and assigning the job to a partition.
	// Doesn't need to be globally unique.
	PartitionId uint32 `protobuf:"varint,1,opt,name=partition_id,json=partitionId,proto3" json:"partition_id,omitempty"`
	// begin is the beginning time of the job.
	//
	// Types that are assignable to Begin:
	//
	//	*JobStored_Start
	//	*JobStored_DueTime
	Begin isJobStored_Begin `protobuf_oneof:"begin"`
	// expiration is the optional time at which the job should no longer be
	// scheduled and will be ignored and garbage collected thereafter.
	// A job may be removed earlier if repeats are exhausted or schedule doesn't
	// permit.
	Expiration *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=expiration,proto3,oneof" json:"expiration,omitempty"`
	// job is the job spec.
	Job *Job `protobuf:"bytes,5,opt,name=job,proto3" json:"job,omitempty"`
	// contains filtered or unexported fields
}

JobStored is the wrapped stored version of a Job which has a partition_id associated.

func (*JobStored) Descriptor deprecated

func (*JobStored) Descriptor() ([]byte, []int)

Deprecated: Use JobStored.ProtoReflect.Descriptor instead.

func (*JobStored) GetBegin

func (m *JobStored) GetBegin() isJobStored_Begin

func (*JobStored) GetDueTime

func (x *JobStored) GetDueTime() *timestamppb.Timestamp

func (*JobStored) GetExpiration

func (x *JobStored) GetExpiration() *timestamppb.Timestamp

func (*JobStored) GetJob

func (x *JobStored) GetJob() *Job

func (*JobStored) GetPartitionId

func (x *JobStored) GetPartitionId() uint32

func (*JobStored) GetStart

func (x *JobStored) GetStart() *timestamppb.Timestamp

func (*JobStored) ProtoMessage

func (*JobStored) ProtoMessage()

func (*JobStored) ProtoReflect

func (x *JobStored) ProtoReflect() protoreflect.Message

func (*JobStored) Reset

func (x *JobStored) Reset()

func (*JobStored) String

func (x *JobStored) String() string

type JobStored_DueTime

type JobStored_DueTime struct {
	// due_time is the epoch time of the job whereby the clock starts on the
	// schedule. The job _will_ trigger at this time.
	DueTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=due_time,json=dueTime,proto3,oneof"`
}

type JobStored_Start

type JobStored_Start struct {
	// start is the epoch time of the job whereby the clock starts on the
	// schedule. The job _will not_ trigger at this time.
	Start *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=start,proto3,oneof"`
}

type TriggerRequest

type TriggerRequest struct {

	// name is the name of the job that was triggered.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// metadata is the arbitrary metadata associated with the job.
	Metadata *anypb.Any `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// payload is the job payload.
	Payload *anypb.Any `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

TriggerRequest is the request sent to the caller when a job is triggered.

func (*TriggerRequest) Descriptor deprecated

func (*TriggerRequest) Descriptor() ([]byte, []int)

Deprecated: Use TriggerRequest.ProtoReflect.Descriptor instead.

func (*TriggerRequest) GetMetadata

func (x *TriggerRequest) GetMetadata() *anypb.Any

func (*TriggerRequest) GetName

func (x *TriggerRequest) GetName() string

func (*TriggerRequest) GetPayload

func (x *TriggerRequest) GetPayload() *anypb.Any

func (*TriggerRequest) ProtoMessage

func (*TriggerRequest) ProtoMessage()

func (*TriggerRequest) ProtoReflect

func (x *TriggerRequest) ProtoReflect() protoreflect.Message

func (*TriggerRequest) Reset

func (x *TriggerRequest) Reset()

func (*TriggerRequest) String

func (x *TriggerRequest) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL