amqp

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const Profile = "amqp"

Variables

This section is empty.

Functions

func BytesToString

func BytesToString(b *[]byte) *string

Types

type AmqpClient

type AmqpClient interface {
	Connect() (cha *amqp.Channel, err error)
	Close()
}

type Channel

type Channel struct {
	*amqp.Channel
}

func (*Channel) Connect

func (chn *Channel) Connect(p *Properties) (err error)

func (*Channel) Create added in v1.3.0

func (chn *Channel) Create(queueName, exchange, key, kind string) error

func (*Channel) CreateFanout added in v1.3.0

func (chn *Channel) CreateFanout(queueName, exchange string) error

CreateFanout 创建Fanout类型的队列

func (*Channel) PublishDirect

func (chn *Channel) PublishDirect(exchange, queueName, mgsConnect, key string) error

func (*Channel) PublishFanout

func (chn *Channel) PublishFanout(exchange, mgsConnect string) error

func (*Channel) Push added in v1.3.0

func (chn *Channel) Push(exchange, key, expiration, mgsConnect string) error

func (*Channel) Receive

func (chn *Channel) Receive(queueName string) (<-chan amqp.Delivery, error)

func (*Channel) ReceiveFanout

func (chn *Channel) ReceiveFanout(queueName, exchange string) (*string, error)

type NewChannel

type NewChannel func() (chn *Channel)

type Properties added in v1.3.0

type Properties struct {
	at.ConfigurationProperties `value:"amqp"`

	Port      int    `json:"port" default:"5672"`
	Username  string `json:"username" default:"guest"`
	Password  string `json:"password" default:"guest"`
	Host      string `json:"host" default:"127.0.0.1"`
	QueueName string `json:"queueName" default:"my-queue"`
	Exchange  string `json:"exchange" default:"my-exchange"`
	SleepTime int64  `json:"sleepTime" default:"3*1e9"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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