amqp

package
v0.50.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package amqp provides a client with included tracing capabilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

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

Message abstraction for publishing.

func NewJSONMessage

func NewJSONMessage(d interface{}) (*Message, error)

NewJSONMessage creates a new message with a JSON encoded body.

func NewMessage

func NewMessage(ct string, body []byte) *Message

NewMessage creates a new message.

func NewProtobufMessage

func NewProtobufMessage(d interface{}) (*Message, error)

NewProtobufMessage creates a new message with a protobuf encoded body.

type OptionFunc

type OptionFunc func(*TracedPublisher) error

OptionFunc definition for configuring the publisher in a functional way.

func Timeout

func Timeout(timeout time.Duration) OptionFunc

Timeout option for adjusting the timeout of the connection.

type Publisher

type Publisher interface {
	Publish(ctx context.Context, msg *Message) error
	Close(ctx context.Context) error
}

Publisher interface of a RabbitMQ publisher.

type TracedPublisher

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

TracedPublisher defines a RabbitMQ publisher with tracing instrumentation.

func NewPublisher

func NewPublisher(url, exc string, oo ...OptionFunc) (*TracedPublisher, error)

NewPublisher creates a new publisher with the following defaults - exchange type: fanout - notifications are not handled at this point TBD.

func (*TracedPublisher) Close

func (tc *TracedPublisher) Close(_ context.Context) error

Close the connection and channel of the publisher.

func (*TracedPublisher) Publish

func (tc *TracedPublisher) Publish(ctx context.Context, msg *Message) error

Publish a message to a exchange.

type User

type User struct {
	Firstname            *string  `protobuf:"bytes,1,req,name=Firstname" json:"Firstname,omitempty"`
	Lastname             *string  `protobuf:"bytes,2,opt,name=Lastname" json:"Lastname,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*User) Descriptor

func (*User) Descriptor() ([]byte, []int)

func (*User) GetFirstname

func (m *User) GetFirstname() string

func (*User) GetLastname

func (m *User) GetLastname() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) Reset

func (m *User) Reset()

func (*User) String

func (m *User) String() string

func (*User) XXX_DiscardUnknown

func (m *User) XXX_DiscardUnknown()

func (*User) XXX_Marshal

func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*User) XXX_Merge

func (m *User) XXX_Merge(src proto.Message)

func (*User) XXX_Size

func (m *User) XXX_Size() int

func (*User) XXX_Unmarshal

func (m *User) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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