Documentation ¶
Index ¶
Constants ¶
View Source
const (
DefaultConsumerBufferCapacity int = 1e3
)
View Source
const (
DefaultProducerWarningNum int = 1e4
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConsumerConfig ¶
type ConsumerHandel ¶
type ConsumerStatus ¶
type MQConfig ¶
type MQConfig struct { Addr string `json:"addr" yaml:"addr"` Username string `json:"username" yaml:"username"` Password string `json:"password" yaml:"password"` Db int `json:"db" yaml:"db"` ReadTimeout time.Duration `json:"readTimeout" yaml:"readTimeout"` WriteTimeout time.Duration `json:"writeTimeout" yaml:"writeTimeout"` DialTimeout time.Duration `json:"dialTimeout" yaml:"dialTimeout"` MaxRetries int `json:"maxRetries" yaml:"maxRetries"` PoolSize int `json:"poolSize" yaml:"poolSize"` PoolTimeout time.Duration `json:"poolTimeout" yaml:"poolTimeout"` }
type MessageQueue ¶
type MessageQueue struct {
// contains filtered or unexported fields
}
func NewMessageQueue ¶
func NewMessageQueue(ctx context.Context, cfg MQConfig) *MessageQueue
func (*MessageQueue) Running ¶
func (mq *MessageQueue) Running()
func (*MessageQueue) Stop ¶
func (mq *MessageQueue) Stop()
type MqConsumer ¶
type MqConsumer struct { ConsumerId string RedisKey string // contains filtered or unexported fields }
func NewConsumer ¶
func NewConsumer(mq *MessageQueue, cfg ConsumerConfig) *MqConsumer
type MqProducer ¶
type MqProducer struct { RedisKey string // contains filtered or unexported fields }
func NewProducer ¶
func NewProducer(mq *MessageQueue, cfg ProducerConfig) *MqProducer
func (*MqProducer) Id ¶
func (producer *MqProducer) Id() string
func (*MqProducer) Start ¶
func (producer *MqProducer) Start() *MqProducer
type ProducerConfig ¶
type ProducerStatus ¶
type Redis ¶
type Redis struct { Addr string `json:"addr" yaml:"addr"` Username string `json:"username" yaml:"username"` Password string `json:"password" yaml:"password"` Db int `json:"db" yaml:"db"` ReadTimeout time.Duration `json:"readTimeout" yaml:"readTimeout"` WriteTimeout time.Duration `json:"writeTimeout" yaml:"writeTimeout"` DialTimeout time.Duration `json:"dialTimeout" yaml:"dialTimeout"` MaxRetries int `json:"maxRetries" yaml:"maxRetries"` MinRetryBackoff time.Duration `json:"minRetryBackoff" yaml:"minRetryBackoff"` MaxRetryBackoff time.Duration `json:"maxRetryBackoff" yaml:"maxRetryBackoff"` PoolSize int `json:"poolSize" yaml:"poolSize"` MinIdleConns int `json:"minIdleConns" yaml:"minIdleConns"` MaxConnAge time.Duration `json:"maxConnAge" yaml:"maxConnAge"` PoolTimeout time.Duration `json:"poolTimeout" yaml:"poolTimeout"` IdleTimeout time.Duration `json:"idleTimeout" yaml:"idleTimeout"` IdleCheckFrequency time.Duration `json:"idleCheckFrequency" yaml:"idleCheckFrequency"` }
Click to show internal directories.
Click to hide internal directories.