events

package
v2.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTag = "<default>"
View Source
const (
	// EventPriorityDefault represents the default priority for an event if
	// none has been Set.
	EventPriorityDefault = iota
)

Variables

View Source
var ErrGeneratorFinished = errors.New("event generator is finished")

Functions

This section is empty.

Types

type Configs

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

func NewConfigs

func NewConfigs() *Configs

func (*Configs) BlockingEvents

func (c *Configs) BlockingEvents(event *Event) []config.Event

func (*Configs) ExpectedGenerators

func (c *Configs) ExpectedGenerators(event *Event) []*config.Generator

func (*Configs) Priority

func (c *Configs) Priority(event *Event) int

func (*Configs) Set

func (c *Configs) Set(config config.Config)

type Event

type Event struct {
	timestone.Action
	time.Time

	context.Context
	// contains filtered or unexported fields
}

func NewEvent

func NewEvent(ctx context.Context, action timestone.Action, time time.Time, tags []string) *Event

func (*Event) Tags

func (e *Event) Tags() []string

type Generator

type Generator interface {
	Pop() *Event
	Peek() Event

	Finished() bool
}

type OnceGenerator

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

func NewOnceGenerator

func NewOnceGenerator(ctx context.Context, action timestone.Action, time time.Time, tags []string) *OnceGenerator

func (*OnceGenerator) Finished

func (o *OnceGenerator) Finished() bool

func (*OnceGenerator) Peek

func (o *OnceGenerator) Peek() Event

func (*OnceGenerator) Pop

func (o *OnceGenerator) Pop() *Event

type PeriodicGenerator

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

func NewPeriodicGenerator

func NewPeriodicGenerator(
	ctx context.Context,
	action timestone.Action,
	from time.Time,
	to *time.Time,
	interval time.Duration,
	tags []string,
) *PeriodicGenerator

func (*PeriodicGenerator) Finished

func (p *PeriodicGenerator) Finished() bool

func (*PeriodicGenerator) Peek

func (p *PeriodicGenerator) Peek() Event

func (*PeriodicGenerator) Pop

func (p *PeriodicGenerator) Pop() *Event

type Queue

type Queue struct {
	NewGeneratorsWaitGroups *waitgroups.GeneratorWaitGroups
	// contains filtered or unexported fields
}

func NewQueue

func NewQueue(configs *Configs) *Queue

func (*Queue) Add

func (q *Queue) Add(generator Generator)

func (*Queue) ExpectGenerators

func (q *Queue) ExpectGenerators(expectedGenerators []*config.Generator)

func (*Queue) Finished

func (q *Queue) Finished() bool

func (*Queue) Peek

func (q *Queue) Peek() Event

func (*Queue) Pop

func (q *Queue) Pop() *Event

func (*Queue) WaitForExpectedGenerators

func (q *Queue) WaitForExpectedGenerators(expectedGenerators []*config.Generator)

Jump to

Keyboard shortcuts

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