events

package
v0.10.3-beta.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package events implements event publisher per baseplate spec.

Deprecated: This package is in maintenance mode and should not be used for new projects. Consider using alternative event publishing solutions for new development.

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.

Deprecated: This package is in maintenance mode. Use alternative event publishing solutions.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config deprecated

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.

Deprecated: This package is in maintenance mode. Use alternative event publishing solutions.

type Queue deprecated

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

A Queue is an event queue.

Deprecated: This package is in maintenance mode. Use alternative event publishing solutions.

func V2 deprecated

func V2() (*Queue, error)

V2 initializes a new v2 event queue with default configurations.

Deprecated: This package is in maintenance mode. Use alternative event publishing solutions.

func V2WithConfig deprecated

func V2WithConfig(cfg Config) (*Queue, error)

V2WithConfig initializes a new v2 event queue.

Deprecated: This package is in maintenance mode. Use alternative event publishing solutions.

func (*Queue) Close deprecated

func (q *Queue) Close() error

Close closes the event queue.

After Close is called, all Put calls will return errors.

Deprecated: This package is in maintenance mode. Use alternative event publishing solutions.

func (*Queue) Put deprecated

func (q *Queue) Put(ctx context.Context, event thrift.TStruct) error

Put serializes and puts an event into the event queue.

Deprecated: This package is in maintenance mode. Use alternative event publishing solutions.

func (*Queue) PutRaw deprecated added in v0.9.10

func (q *Queue) PutRaw(ctx context.Context, rawEvent []byte) error

PutRaw puts a raw, already properly serialized event into the event queue.

In most cases you should use Put instead. This is only provided for some special cases like experiments-v2 custom exposers.

Deprecated: This package is in maintenance mode. Use alternative event publishing solutions.

Jump to

Keyboard shortcuts

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