plugin

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(worker *machinery.Worker, initOptions Options) error

Init adds the event listeners to the machinery worker

Types

type DBEntry

type DBEntry struct {
	ID     primitive.ObjectID `bson:"_id"`
	Queue  string             `bson:"queue"`
	Points []DataPoint        `bson:"points"`
}

DBEntry is one entry in the

func NewEntry

func NewEntry(queue string) DBEntry

NewEntry creates a new DBEntry

func (*DBEntry) NewEntry

func (e *DBEntry) NewEntry(status TaskStatus, ifErrorMsg error)

NewEntry ads an entry to the (*DBEntry).Points

type DataPoint

type DataPoint struct {
	From      int64    `bson:"from" json:"from"`
	Successes int      `bson:"successes" json:"successes"`
	Retries   int      `bson:"retries" json:"retries"`
	Errors    []string `bson:"errors" json:"errors"` // Maybe for later
}

DataPoint tells if an entry is successfull or not

type MongoDBConnectOptions

type MongoDBConnectOptions struct {
	ConnectionURI string `json:"connectionURL"`
	Database      string `json:"database"`
}

MongoDBConnectOptions contains the settings for connecting a mongodb server

type Options

type Options struct {
	Mongodb MongoDBConnectOptions `json:"mongodb"`
}

Options are the options for the Init function And contains all settings for the frontend Currently we only support mongodb as database

type TaskStatus

type TaskStatus uint8

TaskStatus contains the status of a job

const (
	StatusOke TaskStatus = iota + 1
	StatusRetry
	StatusError
)

func (TaskStatus) IsError

func (s TaskStatus) IsError() bool

IsError tells if the task status is error

func (TaskStatus) IsOke

func (s TaskStatus) IsOke() bool

IsOke tells if the task status is oke

func (TaskStatus) IsRetry

func (s TaskStatus) IsRetry() bool

IsRetry tells if the task status is retry

Jump to

Keyboard shortcuts

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