events

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewIterator

func NewIterator(ch <-chan Message) core.Iterator

Types

type Iterator

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

func (*Iterator) Next

func (e *Iterator) Next(ctx context.Context) (value core.Value, key core.Value, err error)

type Message

type Message interface {
	Value() core.Value
	Err() error
}

Message represents an event message that an Observable can emit.

func WithErr

func WithErr(err error) Message

func WithValue

func WithValue(val core.Value) Message

type Observable

type Observable interface {
	Subscribe(ctx context.Context, subscription Subscription) (Stream, error)
}

Observable represents an interface of complex types that returns stream of events.

type Stream

type Stream interface {
	Close(ctx context.Context) error
	Read(ctx context.Context) <-chan Message
}

Stream represents an event stream that produces target event objects.

func Merge

func Merge(inputs ...Stream) Stream

func New

func New(source chan Message) Stream

type Subscription

type Subscription struct {
	EventName string
	Options   *values.Object
}

Subscription represents an event subscription object that contains target event name and optional event options.

Jump to

Keyboard shortcuts

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