amqp

package
v0.0.0-...-c1a9e9f Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelBindings

type ChannelBindings struct {
	ChannelType           ChannelType
	ExchangeConfiguration ExchangeConfiguration
	QueueConfiguration    QueueConfiguration

	PublisherBindings  OperationBindings
	SubscriberBindings OperationBindings
}

type ChannelType

type ChannelType string
const (
	ChannelTypeRoutingKey ChannelType = "routingKey"
	ChannelTypeQueue      ChannelType = "queue"
)

type Consumer

type Consumer interface {
	Subscriber(ctx context.Context, channelName string, bindings *ChannelBindings) (Subscriber, error)
}

Sub

type DeliveryMode

type DeliveryMode int
const (
	DeliveryModeTransient  DeliveryMode = 1
	DeliveryModePersistent DeliveryMode = 2
)

type EnvelopeMarshaler

type EnvelopeMarshaler interface {
	MarshalAMQPEnvelope(envelope EnvelopeWriter) error
}

type EnvelopeReader

type EnvelopeReader interface {
	io.Reader
	Headers() run.Headers

	Ack() error
	Nack(requeue bool) error
	Reject(requeue bool) error
}

Sub

type EnvelopeUnmarshaler

type EnvelopeUnmarshaler interface {
	UnmarshalAMQPEnvelope(envelope EnvelopeReader) error
}

type EnvelopeWriter

type EnvelopeWriter interface {
	io.Writer
	ResetPayload()
	SetHeaders(headers run.Headers)
	SetContentType(contentType string)
	SetBindings(bindings MessageBindings)

	SetRoutingKey(tag string) // TODO: remove? sets in SealEnvelope
}

Pub

type ExchangeConfiguration

type ExchangeConfiguration struct {
	Name       *string // Empty name points to default broker exchange
	Type       ExchangeType
	Durable    *bool
	AutoDelete *bool
	VHost      string
}

type ExchangeType

type ExchangeType string
const (
	ExchangeTypeDefault ExchangeType = "default"
	ExchangeTypeTopic   ExchangeType = "topic"
	ExchangeTypeDirect  ExchangeType = "direct"
	ExchangeTypeFanout  ExchangeType = "fanout"
	ExchangeTypeHeaders ExchangeType = "headers"
)

type MessageBindings

type MessageBindings struct {
	ContentEncoding string
	MessageType     string
}

type OperationBindings

type OperationBindings struct {
	Expiration   time.Duration
	UserID       string
	CC           []string
	Priority     int
	DeliveryMode DeliveryMode
	Mandatory    bool
	BCC          []string
	ReplyTo      string
	Timestamp    bool
	Ack          bool
}

type Producer

type Producer interface {
	Publisher(ctx context.Context, channelName string, bindings *ChannelBindings) (Publisher, error)
}

Pub

type Publisher

type Publisher interface {
	Send(ctx context.Context, envelopes ...EnvelopeWriter) error
	Close() error
}

Pub

type QueueConfiguration

type QueueConfiguration struct {
	Name       string
	Durable    *bool
	Exclusive  *bool
	AutoDelete *bool
	VHost      string
}

type ServerBindings

type ServerBindings struct{}

type Subscriber

type Subscriber interface {
	Receive(ctx context.Context, cb func(envelope EnvelopeReader)) error
	Close() error
}

Sub

Jump to

Keyboard shortcuts

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