Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Debug bool
Debug debug log flag
Functions ¶
This section is empty.
Types ¶
type AMQPEnv ¶
type AMQPEnv struct {
User string `env:"RABBIT_USER" envDefault:"guest"`
Password string `env:"RABBIT_PASSWORD" envDefault:"guest"`
URL string `env:"RABBIT_URL" envDefault:"localhost"`
Vhost string `env:"RABBIT_VHOST" envDefault:""`
CredentialsFile string `env:"RABBIT_CREDENTIALS_FILE" envDefault:""`
Protocol string `env:"RABBIT_PROTOCOL" envDefault:"amqp"`
}
type Channel ¶
Channel amqp.Channel wapper
type Connection ¶
type Connection struct {
*amqp.Connection
}
Connection amqp.Connection wrapper
func Dial ¶
func Dial(url string) (*Connection, error)
Dial wrap amqp.Dial, dial and get a reconnect connection
func (*Connection) Channel ¶
func (c *Connection) Channel() (*Channel, error)
Channel wrap amqp.Connection.Channel, get a auto reconnect channel
type RabbitClient ¶
type RabbitClient struct {
*Connection
AppName string
PublisherMode bool
// contains filtered or unexported fields
}
func NewRabbitClient ¶
func NewRabbitClient(cfg Config) *RabbitClient
func (*RabbitClient) Close ¶
func (r *RabbitClient) Close() error
func (*RabbitClient) Subscriber ¶
Click to show internal directories.
Click to hide internal directories.