rabbit

package
v1.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupClient

func SetupClient(cfg *Config) (*amqp.Channel, func(), error)

SetupClient ... 初始化 rabbit 连接,并创建一个通道

Types

type Config

type Config struct {
	Host     string `env:"RABBIT_HOST,default:localhost"`
	Port     string `env:"RABBIT_PORT"`
	User     string `env:"RABBIT_USER"`
	Password string `env:"RABBIT_PASSWORD"`
	VHost    string `env:"RABBIT_VHOST"`
}

Config ... rabbit配置

func NewConfig

func NewConfig() (*Config, error)

func (*Config) ParseFromEnvironment

func (c *Config) ParseFromEnvironment() error

ParseFromEnvironment ... 从环境变量中读取配置值

func (*Config) String

func (c *Config) String() string

String ...

func (*Config) StringSafely

func (c *Config) StringSafely() string

StringSafely ...

Jump to

Keyboard shortcuts

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