amqp_pool

package module
v0.0.0-...-2c5a816 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

README

ramq-pool

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

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

func NewChannel

func NewChannel(ch *amqp.Channel) *Channel

func (*Channel) ExchangeDeclare

func (c *Channel) ExchangeDeclare(config *ExchangeDeclareConfig) error

func (*Channel) Publish

func (c *Channel) Publish(data *PublishData) error

func (*Channel) QueueDeclare

func (c *Channel) QueueDeclare(config *QueueDeclareConfig) (amqp.Queue, error)

type ChannelPool

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

func NewChannelPool

func NewChannelPool(pool *list.List) *ChannelPool

func (*ChannelPool) Get

func (p *ChannelPool) Get() (*Channel, error)

func (*ChannelPool) Release

func (p *ChannelPool) Release(channel *Channel)

type ChannelService

type ChannelService interface {
	Publish() error
}

type ConnPoolConfig

type ConnPoolConfig struct {
	ConnNum uint16
	Url     string
}

type Connection

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

func NewConnection

func NewConnection(config *ConnectionConfig) *Connection

func (*Connection) GetChannelPool

func (c *Connection) GetChannelPool() *ChannelPool

type ConnectionConfig

type ConnectionConfig struct {
	ChanNum uint16
	Url     string
}

type ConnectionPool

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

func NewConnectionPool

func NewConnectionPool(config *ConnPoolConfig) *ConnectionPool

func (*ConnectionPool) Get

func (c *ConnectionPool) Get() (*Connection, error)

func (*ConnectionPool) Release

func (c *ConnectionPool) Release(conn *Connection)

type ExchangeDeclareConfig

type ExchangeDeclareConfig struct {
	Name       string
	Kind       string
	Durable    bool
	AutoDelete bool
	Internal   bool
	NoWait     bool
	Args       amqp.Table
}

name, kind string, durable, autoDelete, internal, noWait bool, args Table

type PublishData

type PublishData struct {
	Exchange  string
	Key       string
	Mandatory bool // 如果没有队列 true 返回给生产者 false 会丢掉
	Immediate bool // 如果没有消费者 true 返回给生产者,false 丢入队列
	Msg       amqp.Publishing
}

type QueueDeclareConfig

type QueueDeclareConfig struct {
	Name       string
	Durable    bool
	AutoDelete bool
	Exclusive  bool
	NoWait     bool
	Args       amqp.Table
}

name string, durable, autoDelete, exclusive, noWait bool, args Table

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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