window

package
v0.5.0-beta1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregator

type Aggregator interface {
	Aggregate(ctx context.Context, input interface{}, item Whiteboard) (err error)
	OnTrigger(ctx context.Context) error
}

type CountAggregator

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

func (*CountAggregator) Aggregate

func (ca *CountAggregator) Aggregate(ctx context.Context, input interface{}, item Whiteboard) (err error)

func (*CountAggregator) OnTrigger

func (ca *CountAggregator) OnTrigger(ctx context.Context) error

type DurationTrigger

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

func (*DurationTrigger) Aggregate

func (trigger *DurationTrigger) Aggregate(ctx context.Context, input interface{}, item Whiteboard) (err error)

func (*DurationTrigger) OnTrigger

func (trigger *DurationTrigger) OnTrigger(ctx context.Context) error

type EmptyAggregator

type EmptyAggregator struct{}

func (EmptyAggregator) Aggregate

func (agg EmptyAggregator) Aggregate(ctx context.Context, input interface{}, item Whiteboard) (err error)

func (EmptyAggregator) OnTrigger

func (agg EmptyAggregator) OnTrigger(ctx context.Context) error

type Trigger

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

func (*Trigger) Trigger

func (tm *Trigger) Trigger()

func (*Trigger) Triggered

func (tm *Trigger) Triggered() bool

type Whiteboard

type Whiteboard struct {
	StartTime    time.Time
	Seq          uint64
	TriggerErr   error
	HasTriggered bool
	Trigger      *Trigger
}

type Window

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

func New

func New(ag Aggregator, wraps ...Wrapper) *Window

func (*Window) Accept

func (w *Window) Accept(ctx context.Context, input interface{}) error

func (*Window) ClearErr

func (w *Window) ClearErr(ctx context.Context) bool

func (*Window) Close

func (w *Window) Close(ctx context.Context) error

func (*Window) Closed

func (w *Window) Closed() chan<- struct{}

func (*Window) Current

func (w *Window) Current(ctx context.Context) (Whiteboard, bool)

type Wrapper

type Wrapper func(Aggregator) Aggregator

func CounterWrapper

func CounterWrapper(maxCount uint64) Wrapper

func DurationWrapper

func DurationWrapper(duration time.Duration) Wrapper

Jump to

Keyboard shortcuts

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