event

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2020 License: BSD-3-Clause Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Data   string
	Id     string
	Event  string
	Retry  time.Duration
	Ending bool
}

type Events

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

Events handles a flow of Event

func NewEvents

func NewEvents() *Events

NewEvents return a new Events

func (*Events) Append

func (e *Events) Append(evt *Event)

Append an Event

func (*Events) Close

func (e *Events) Close()

Close this Events

func (*Events) NextEventId added in v0.4.0

func (e *Events) NextEventId() string

func (*Events) SetPrems added in v0.2.0

func (e *Events) SetPrems(prems func(context.Context) *Event)

SetPrems sent the initial Event when a client subscribe

func (*Events) Since

func (e *Events) Since(since int) []*Event

Since returns all Event since an id

func (*Events) Size

func (e *Events) Size() int

Size of this Events collection

func (*Events) Subscribe

func (e *Events) Subscribe(ctx context.Context) chan *Event

Subscribe for future Event

func (*Events) SubscribeSince added in v0.3.0

func (e *Events) SubscribeSince(ctx context.Context, since int) chan *Event

SubscribeSince subscribes to a list of Event, past and future

Jump to

Keyboard shortcuts

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