task

package
v0.0.0-...-aecaba9 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor interface {
	Execute(message []byte) error
}

Executor can execute a certain from a kafka message

type JobRunnerExecutor

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

JobRunnerExecutor executes MediaWiki jobs via event bus

func DefaultJobRunnerExecutor

func DefaultJobRunnerExecutor() *JobRunnerExecutor

DefaultJobRunnerExecutor creates a job runner executor based on config.yml

func NewJobRunnerExecutor

func NewJobRunnerExecutor(endpoint string, excludeFields []string) *JobRunnerExecutor

NewJobRunnerExecutor creates a new job runner executor

func (*JobRunnerExecutor) Execute

func (t *JobRunnerExecutor) Execute(message []byte) error

Execute sends a job in the kafka message to the endpoint

type PurgeExecutor

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

PurgeExecutor purges the front-end cache by URLs

func DefaultPurgeExecutor

func DefaultPurgeExecutor() *PurgeExecutor

DefaultPurgeExecutor creates a purge executor based on config.yml

func NewPurgeExecutor

func NewPurgeExecutor(expiry time.Duration, entries []utils.PurgeEntryConfig, cfAPI *cloudflare.API, cfZoneID string) *PurgeExecutor

NewPurgeExecutor creates a new purge executor

func (*PurgeExecutor) Execute

func (t *PurgeExecutor) Execute(message []byte) error

Execute sends the corresponding PURGE requests from a kafka message

type Type

type Type int16

Type is an enum for task types

const (
	// JobRunnerTask executes a MediaWiki job via event bus
	JobRunnerTask Type = iota
	// PurgeTask purges the front-end cache of a URL
	PurgeTask
)

func TypeFromString

func TypeFromString(s string) Type

TypeFromString returns a task type from a string

func (Type) GetExecutor

func (t Type) GetExecutor() Executor

GetExecutor returns a task executor for a task type

func (Type) String

func (t Type) String() string

Jump to

Keyboard shortcuts

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