jobmodels

package
v0.0.0-...-37eefcc Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_models_jobmodels_job_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Empty

type Empty struct {
	// contains filtered or unexported fields
}

Empty message because grpc doesnt allow methods without return

func (*Empty) Descriptor deprecated

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

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

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

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

type Job

type Job struct {
	ID string `json:"id,omitempty" bson:"id,omitempty"`

	// Trigger time in milliseconds
	TriggerMS int             `json:"trigger_ms,omitempty" bson:"trigger_ms,omitempty"`
	Meta      json.RawMessage `json:"meta,omitempty" bson:"meta,omitempty"`
	Route     string          `json:"route,omitempty" bson:"route,omitempty"`
}

func GetJobFromBytes

func GetJobFromBytes(by []byte) (*Job, error)

GetJobFromBytes returns the job struct from byte array TODO: Change to msgpack later

func (*Job) GetMinuteBucketName

func (j *Job) GetMinuteBucketName() []byte

func (*Job) GetUniqueKey

func (j *Job) GetUniqueKey(collection string) []byte

returns collection + "_" + job.ID

func (*Job) StringifyTriggerTime

func (j *Job) StringifyTriggerTime() []byte

func (*Job) ToBytes

func (j *Job) ToBytes() ([]byte, error)

TODO: Change to msgpack later

func (*Job) Valid

func (j *Job) Valid() error

type JobCreationDetails

type JobCreationDetails struct {
	ID          string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	TriggerTime int64  `protobuf:"varint,2,opt,name=TriggerTime,proto3" json:"TriggerTime,omitempty"`
	Meta        []byte `protobuf:"bytes,3,opt,name=Meta,proto3" json:"Meta,omitempty"`
	Route       string `protobuf:"bytes,4,opt,name=Route,proto3" json:"Route,omitempty"`
	Collection  string `protobuf:"bytes,5,opt,name=Collection,proto3" json:"Collection,omitempty"`
	// contains filtered or unexported fields
}

Used to create jobs

func (*JobCreationDetails) Descriptor deprecated

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

Deprecated: Use JobCreationDetails.ProtoReflect.Descriptor instead.

func (*JobCreationDetails) GetCollection

func (x *JobCreationDetails) GetCollection() string

func (*JobCreationDetails) GetID

func (x *JobCreationDetails) GetID() string

func (*JobCreationDetails) GetMeta

func (x *JobCreationDetails) GetMeta() []byte

func (*JobCreationDetails) GetRoute

func (x *JobCreationDetails) GetRoute() string

func (*JobCreationDetails) GetTriggerTime

func (x *JobCreationDetails) GetTriggerTime() int64

func (*JobCreationDetails) ProtoMessage

func (*JobCreationDetails) ProtoMessage()

func (*JobCreationDetails) ProtoReflect

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

func (*JobCreationDetails) Reset

func (x *JobCreationDetails) Reset()

func (*JobCreationDetails) String

func (x *JobCreationDetails) String() string

type JobFetchDetails

type JobFetchDetails struct {
	ID         string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	Collection string `protobuf:"bytes,2,opt,name=Collection,proto3" json:"Collection,omitempty"`
	// contains filtered or unexported fields
}

Used to fetch and delete job

func (*JobFetchDetails) Descriptor deprecated

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

Deprecated: Use JobFetchDetails.ProtoReflect.Descriptor instead.

func (*JobFetchDetails) GetCollection

func (x *JobFetchDetails) GetCollection() string

func (*JobFetchDetails) GetID

func (x *JobFetchDetails) GetID() string

func (*JobFetchDetails) ProtoMessage

func (*JobFetchDetails) ProtoMessage()

func (*JobFetchDetails) ProtoReflect

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

func (*JobFetchDetails) Reset

func (x *JobFetchDetails) Reset()

func (*JobFetchDetails) String

func (x *JobFetchDetails) String() string

Jump to

Keyboard shortcuts

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