Documentation
¶
Overview ¶
Package queue provides ficilities for working with message queues.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrStopped is returned when the queue is stopped. ErrStopped = errors.New("stopped") // ErrFull is returned when the queue is full. ErrFull = errors.New("full") )
Functions ¶
This section is empty.
Types ¶
type M ¶
type M struct {
ID string
ContentType string
ContentLength int // In bytes
CreatedAt time.Time
Metadata Metadata
Body []byte
}
M is a queue message.
type PubSub ¶
type PubSub[K comparable, E any] interface { Server Pub(context.Context, E) error Sub(context.Context, K) (Subscription[E], error) }
PubSub is an interface for the Publish–Subscribe pattern.
type Subscription ¶
Click to show internal directories.
Click to hide internal directories.