event

package
v0.0.0-...-865cf51 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(evt Event) ([]byte, error)

Types

type Event

type Event interface {
	GetEvent() string
	GetData() string
	GetId() string
	SetId(id string)
	GetRetry() int
	GetStreamID() string
	Write(w io.Writer) (n int, err error)
}

func Decode

func Decode(data []byte) (evt Event, err error)

func Full

func Full(streamID string, name, data, id string, retry int) Event

func Message

func Message(streamID string, data string) Event

func MessageId

func MessageId(streamID string, data, id string) Event

type Source

type Source interface {
	Send(ctx context.Context, evt Event) error
	Recv(ctx context.Context) <-chan Event
	// Recv(ctx context.Context) (<-chan Event, error)
	Events(ctx context.Context, streamIDs []string) []Event
	EventsFromLastEventID(ctx context.Context, lastEventID string, streamIDs []string) []Event
}

type SourceFactoryFunc

type SourceFactoryFunc func(ctx context.Context, eventStreamID string) (Source, error)

Directories

Path Synopsis
source

Jump to

Keyboard shortcuts

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