job

package
v2.0.1-a-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GlobalQueue     = Queue("global")
	SchedulersQueue = Queue("schedulers")
	CDNsQueue       = Queue("cdns")
)

Queue Name

View Source
const (
	DefaultResultsExpireIn = 86400
)
View Source
const (
	PreheatJob = "preheat"
)

Job Name

Variables

This section is empty.

Functions

func MarshalRequest

func MarshalRequest(v interface{}) ([]machineryv1tasks.Arg, error)

func UnmarshalRequest

func UnmarshalRequest(data string, v interface{}) error

func UnmarshalResponse

func UnmarshalResponse(data []reflect.Value, v interface{}) error

Types

type Config

type Config struct {
	Host      string
	Port      int
	Password  string
	BrokerDB  int
	BackendDB int
}

type GroupJobState

type GroupJobState struct {
	GroupUUID string
	State     string
	CreatedAt time.Time
}

type Job

type Job struct {
	Server *machinery.Server
	Worker *machinery.Worker
	Queue  Queue
}

func New

func New(cfg *Config, queue Queue) (*Job, error)

func (*Job) GetGroupJobState

func (t *Job) GetGroupJobState(groupUUID string) (*GroupJobState, error)

func (*Job) LaunchWorker

func (t *Job) LaunchWorker(consumerTag string, concurrency int) error

func (*Job) RegisterJob

func (t *Job) RegisterJob(namedJobFuncs map[string]interface{}) error

type PreheatRequest

type PreheatRequest struct {
	URL     string            `json:"url" validate:"required,url"`
	Tag     string            `json:"tag" validate:"required"`
	Digest  string            `json:"digest" validate:"omitempty"`
	Filter  string            `json:"filter" validate:"omitempty"`
	Headers map[string]string `json:"headers" validate:"omitempty"`
}

type PreheatResponse

type PreheatResponse struct {
}

type Queue

type Queue string

func GetCDNQueue

func GetCDNQueue(hostname string) (Queue, error)

func GetSchedulerQueue

func GetSchedulerQueue(hostname string) (Queue, error)

func (Queue) String

func (q Queue) String() string

Jump to

Keyboard shortcuts

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