ops

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadCronSpec = errors.New("bad cron spec")

ErrBadCronSpec is returned when an job spec is not parseable

Functions

This section is empty.

Types

type Cron

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

Cron send an specific message at scheduled intervals

func NewCron

func NewCron(opts CronOptions) *Cron

NewCron create a new Cron Worker with given options

func (*Cron) Process

func (c *Cron) Process(ctx context.Context, args selina.ProcessArgs) error

Process add a job scec, any message received will be discarded when input is closed this worker return nil

type CronOptions

type CronOptions struct {
	// Spec use same format as github.com/robfig/cron/v3
	// Second Minute Hour DayOfMonth Month DayOfWeek
	Spec string
	// Which message will be sent every schedule
	Message []byte
}

CronOptions customize cron behaviour

func (CronOptions) Check added in v0.8.0

func (o CronOptions) Check() error

Check if a combination of options is valid

type TimeSerie added in v0.22.0

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

TimeSerie generate time and values in a given time range

func NewTimeSerie added in v0.22.0

func NewTimeSerie(opts TimeSerieOptions) *TimeSerie

NewTimeSerie create a new TimeSerie generator with given options

func (*TimeSerie) Process added in v0.22.0

func (t *TimeSerie) Process(ctx context.Context, args selina.ProcessArgs) error

Process generate timeseries and put it out in a channel

type TimeSerieOptions added in v0.22.0

type TimeSerieOptions struct {
	Start       time.Time
	Stop        time.Time
	Step        time.Duration
	Generator   func(time.Time) float64
	WriteFormat selina.Marshaler
}

TimeSerieOptions customize optiosn for generation

Jump to

Keyboard shortcuts

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