Documentation ¶
Overview ¶
Package events implements event publisher per baseplate spec.
This package is mainly just the serialization part. The actual publishing part is handled by sidecar implemented by baseplate.py, and communicated via mqsend package.
Index ¶
Constants ¶
View Source
const ( // Max size in bytes for a single, serialized event. MaxEventSize = 102400 // Max size of the events allowed in the message queue at one time. MaxQueueSize = 10000 // Prefix added to the message queue name. QueueNamePrefix = "events-" // The default message queue name for v2 events. DefaultV2Name = "v2" )
Configuration values for the message queue.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // The name of the message queue, should not contain the "events-" prefix. // // For v2 events, the default name (when passed in Name is empty) is "v2". Name string `yaml:"name"` // The max timeout applied to Put function. // // If the passed in context object already has an earlier deadline set, // that deadline will be respected instead. // // If MaxPutTimeout <= 0, // Put function would run in non-blocking mode, // that it fails immediately if the queue is full. MaxPutTimeout time.Duration `yaml:"maxPutTimeout"` // The max size of the message queue (number of messages). // // If it <=0 or > MaxQueueSize (the constant, 10000), // MaxQueueSize constant will be used instead. MaxQueueSize int64 `yaml:"maxQueueSize"` }
The Config used to initialize an event queue.
Can be deserialized from YAML.
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
A Queue is an event queue.
func V2WithConfig ¶
V2WithConfig initializes a new v2 event queue.
func (*Queue) Close ¶
Close closes the event queue.
After Close is called, all Put calls will return errors.
Click to show internal directories.
Click to hide internal directories.