stream

package
v0.0.0-...-d724b4b Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Date      time.Time `json:"date"`
	Type      string    `json:"type"`
	SessionID string    `json:"sessionID"`
}

Event to be windowed.

type EventWindow

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

EventWindow on a stream.

func NewEventWindow

func NewEventWindow(maxAge time.Duration, exit func(head Event, tail []Event)) *EventWindow

NewEventWindow creates a window against events.

func (*EventWindow) Push

func (ew *EventWindow) Push(e Event)

Push an event into the Windower.

func (*EventWindow) Window

func (ew *EventWindow) Window() (events []Event)

Window returns the window of current events.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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