jobs

package
v0.0.0-...-4cee859 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidData = errors.Unwrap(fmt.Errorf("Invalid args for data processing job"))
View Source
var ErrInvalidMsg = errors.Unwrap(fmt.Errorf("Invalid args for message processing job"))

Functions

This section is empty.

Types

type CsvStoreJob

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

func (*CsvStoreJob) Kind

func (c *CsvStoreJob) Kind() string

func (*CsvStoreJob) Perform

func (c *CsvStoreJob) Perform(ctx context.Context, args ...interface{}) error

func (*CsvStoreJob) Run

func (c *CsvStoreJob) Run(ctx context.Context, args ...interface{}) error

type DummyManager

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

func (*DummyManager) Perform

func (d *DummyManager) Perform(job Job, msgs ...*Message) error

func (*DummyManager) Register

func (f *DummyManager) Register(job Job) error

func (*DummyManager) Run

func (f *DummyManager) Run(ctx context.Context) error

type ExpectsJob

type ExpectsJob struct {
	Called bool
}

func (*ExpectsJob) Kind

func (e *ExpectsJob) Kind() string

func (*ExpectsJob) Perform

func (e *ExpectsJob) Perform(ctx context.Context, args ...interface{}) error

func (*ExpectsJob) Run

func (e *ExpectsJob) Run(ctx context.Context, args ...interface{}) error

type FaktoryManager

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

func (*FaktoryManager) Perform

func (f *FaktoryManager) Perform(job Job, msgs ...*Message) error

func (*FaktoryManager) Register

func (f *FaktoryManager) Register(job Job) error

func (*FaktoryManager) Run

func (f *FaktoryManager) Run(ctx context.Context) error

type Job

type Job interface {
	Kind() string
	Run(ctx context.Context, args ...interface{}) error
}

func NewCsvStoreJob

func NewCsvStoreJob(kind string, cfg *config.Config, store store.Store) Job

func NewJsonStoreJob

func NewJsonStoreJob(kind string, cfg *config.Config, store store.Store) Job

type JsonStoreJob

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

func (*JsonStoreJob) Kind

func (r *JsonStoreJob) Kind() string

func (*JsonStoreJob) Perform

func (r *JsonStoreJob) Perform(ctx context.Context, args ...interface{}) error

func (*JsonStoreJob) Run

func (r *JsonStoreJob) Run(ctx context.Context, args ...interface{}) error

type Manager

type Manager interface {
	Register(Job) error
	Perform(Job, ...*Message) error
	Run(context.Context) error
}

func NewDummyManager

func NewDummyManager(cfg *config.Config) Manager

func NewFaktoryManager

func NewFaktoryManager(cfg *config.Config) Manager

type Message

type Message struct {
	ProcessedAt int64       `json:"processed_at" mapstructure:"processed_at" csv:"processed_at"`
	HappenedAt  int64       `json:"happened_at" mapstructure:"happened_at" csv:"happened_at"`
	ID          string      `json:"id" csv:"id"`
	Kind        string      `json:"kind" csv:"kind"`
	Value       interface{} `json:"value" csv:"value"`
}

func NewMessageFromArg

func NewMessageFromArg(arg interface{}) (*Message, error)

Jump to

Keyboard shortcuts

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