projections

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

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

Go to latest
Published: Jul 9, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyFunc

type ApplyFunc interface{}

type DoneFunc

type DoneFunc interface{}

type FilterFunc

type FilterFunc func(msg interface{}) bool

type InitFunc

type InitFunc interface{}

type PartionedProjectionBuilder

type PartionedProjectionBuilder struct {
	*StreamProjectionBuilder
	// contains filtered or unexported fields
}

func (*PartionedProjectionBuilder) Apply

func (*PartionedProjectionBuilder) Build

func (*PartionedProjectionBuilder) Done

func (*PartionedProjectionBuilder) Init

func (*PartionedProjectionBuilder) Persist

func (b *PartionedProjectionBuilder) Persist(name string, obj interface{}) *PartionedProjectionBuilder

func (*PartionedProjectionBuilder) ToStream

func (*PartionedProjectionBuilder) ToStreams

type PartitionFunc

type PartitionFunc func(msg interface{}) (key string, value interface{})

type Projection

type Projection interface {
	Run(in streams.Readable) []ProjectionState
}

type ProjectionState

type ProjectionState interface{}

type ReduceFunc

type ReduceFunc func(accumulator interface{}, currentValue interface{}) interface{}

type SplitToStreamsFunc

type SplitToStreamsFunc func(s []ProjectionState) map[string][]ProjectionState

type StreamProjection

type StreamProjection struct {
	FromStreams   []string
	ToStreams     SplitToStreamsFunc
	Projection    Projection
	PersistTo     string
	PersistObject interface{}
}

type StreamProjectionBuilder

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

func FromStream

func FromStream(name string) *StreamProjectionBuilder

func FromStreams

func FromStreams(names ...string) *StreamProjectionBuilder

func (*StreamProjectionBuilder) Apply

func (*StreamProjectionBuilder) Build

func (*StreamProjectionBuilder) Daily

func (*StreamProjectionBuilder) Done

func (*StreamProjectionBuilder) Filter

func (*StreamProjectionBuilder) Hourly

func (*StreamProjectionBuilder) Init

func (*StreamProjectionBuilder) Monthly

func (*StreamProjectionBuilder) PartitionBy

func (*StreamProjectionBuilder) Persist

func (b *StreamProjectionBuilder) Persist(name string, obj interface{}) *StreamProjectionBuilder

func (*StreamProjectionBuilder) Quarterly

func (*StreamProjectionBuilder) Reduce

func (b *StreamProjectionBuilder) Reduce(fn ReduceFunc, initialValue interface{}) *StreamProjectionBuilder

func (*StreamProjectionBuilder) TimeSeries

func (*StreamProjectionBuilder) ToStream

func (*StreamProjectionBuilder) ToStreams

func (*StreamProjectionBuilder) Weekly

func (*StreamProjectionBuilder) Yearly

type StreamProjectionEngine

type StreamProjectionEngine interface {
	SetLogger(logger log.Logger)
	Register(streamProjection *StreamProjection)
}

type TimePartitioner

type TimePartitioner interface {
	Partition(msg interface{}) time.Time
	GetFormat() string
	FillMissingValues(data []*timeProjectionState) []*timeProjectionState
	Window(preceeding, following int, data []interface{}) []*WindowSlice
}

type TimePartitionerBase

type TimePartitionerBase struct {
	ExtractTimeFn TimeSeriesPartitionFunc
	StepFn        func(time.Time) time.Time
	Format        string
}

func NewTimeSeriesPartitionerBase

func NewTimeSeriesPartitionerBase(extractTimeFn TimeSeriesPartitionFunc, stepFn func(time.Time) time.Time, format string) *TimePartitionerBase

func (*TimePartitionerBase) FillMissingValues

func (p *TimePartitionerBase) FillMissingValues(data []*timeProjectionState) []*timeProjectionState

func (*TimePartitionerBase) GetFormat

func (p *TimePartitionerBase) GetFormat() string

func (*TimePartitionerBase) Window

func (p *TimePartitionerBase) Window(preceeding, following int, data []interface{}) []*WindowSlice

type TimeSeriesPartitionFunc

type TimeSeriesPartitionFunc func(msg interface{}) time.Time

type TimeSeriesProjectionBuilder

type TimeSeriesProjectionBuilder struct {
	*PartionedProjectionBuilder
	// contains filtered or unexported fields
}

func (*TimeSeriesProjectionBuilder) Apply

func (*TimeSeriesProjectionBuilder) Build

func (*TimeSeriesProjectionBuilder) Done

func (*TimeSeriesProjectionBuilder) Init

func (*TimeSeriesProjectionBuilder) Persist

func (b *TimeSeriesProjectionBuilder) Persist(name string, obj interface{}) *TimeSeriesProjectionBuilder

func (*TimeSeriesProjectionBuilder) ToStream

func (*TimeSeriesProjectionBuilder) ToStreams

func (*TimeSeriesProjectionBuilder) Window

func (b *TimeSeriesProjectionBuilder) Window(preceeding, following int, format string, fn TimeWindowApplyFunc) *TimeSeriesProjectionBuilder

type TimeSeriesProjectionState

type TimeSeriesProjectionState struct {
	ProjectionState
}

type TimeSeriesWindowFunc

type TimeSeriesWindowFunc func(t time.Time) (windowTime time.Time, windowKey string)

type TimeWindowApplyFunc

type TimeWindowApplyFunc interface{}

type WindowSlice

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

Jump to

Keyboard shortcuts

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