events

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCompletedEvent added in v0.6.0

func NewCompletedEvent(message string)

NewCompletedEvent is used to publish completed event

func NewErrorEvent added in v0.6.0

func NewErrorEvent(err error, description string)

NewErrorEvent is used to publish error event

func NewEvent

func NewEvent(eventType EventType, message string)

NewEvent is used to publish new event

func NewStatusEvent added in v0.6.0

func NewStatusEvent(message string)

NewStatusEvent is used to publish status event

Types

type Event

type Event struct {
	Type    EventType `json:"type"`
	Message string    `json:"message"`
}

Event is struct for events

func GetEvent

func GetEvent(data string) (*Event, error)

GetEvent is used to read published event

type EventAwaiter added in v0.6.0

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

func NewEventAwaiter added in v0.6.0

func NewEventAwaiter() *EventAwaiter

func (*EventAwaiter) AwaitCompletedEvent added in v0.6.0

func (ep *EventAwaiter) AwaitCompletedEvent(stream io.Reader) (string, error)

type EventType

type EventType string

EventType is type for further parsing

const (
	Error     EventType = "error"
	Status    EventType = "status"
	Completed EventType = "completed"
)

available event types

Jump to

Keyboard shortcuts

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