event

package
v0.1.0-alpha2 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: MIT Imports: 1 Imported by: 0

README

Events

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	// Key sets the key of the message for routing policy
	Key string
	// Payload for the message
	Payload []byte
	// Properties attach application defined properties on the message
	Properties map[string]string
}

Event is an abstraction for all messages that are sent to queue or received from queue.

type Handler

type Handler func(context.Context, Event) error

Handler is a callback function that processes messages delivered to asynchronous subscribers.

type Publisher

type Publisher interface {
	Publish(ctx context.Context, event Event) error
	Close() error
}

Publisher is abstraction for sending messages to queue.

type Subscriber

type Subscriber interface {
	Subscribe(ctx context.Context, h Handler) error
	Close() error
}

Subscriber is an abstraction for receiving messages from queue.

Jump to

Keyboard shortcuts

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