msgqueue

package
v0.0.0-...-906b757 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	Receive(ctx context.Context, data []byte, attributes map[string]string) error
}

type MsgAttributes

type MsgAttributes struct {
	DelayInSeconds int
	MessageType    string
	AggregationID  string
	Original       map[string]string
}

func NewMsgAttributes

func NewMsgAttributes(attributes map[string]string) (MsgAttributes, error)

func (MsgAttributes) GetAttributes

func (m MsgAttributes) GetAttributes() map[string]string

type PublishResult

type PublishResult interface {
	GetMessageID(ctx context.Context) (string, error)
}

type Publisher

type Publisher interface {
	io.Closer
	TopicID() string
	Publish(ctx context.Context, data []byte, attributes map[string]string) (PublishResult, error)
}

func NewPublisher

func NewPublisher(ctx context.Context, projectID string, topicID string) (Publisher, error)

type Receiver

type Receiver interface {
	io.Closer
	Run(ctx context.Context, handler Handler) error
}

func NewReceiver

func NewReceiver(ctx context.Context, projectID string, subscriptionID string) (Receiver, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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