Documentation ¶
Index ¶
- Constants
- func SubscribeMessageByQueue(worker WorkerI, arguments amqp.Table) (err error)
- func SubscribeMessages(worker WorkerI, arguments amqp.Table) (err error)
- type Exception
- type RabbitMqConnect
- func (conn *RabbitMqConnect) DeclareExchange(name, kind string, durable, autoDelete, internal, noWait bool, ...) error
- func (conn *RabbitMqConnect) DeclareQueue(queueName string, durable, autoDelete, internal, noWait bool, ...) error
- func (conn *RabbitMqConnect) PublishMessageToQueue(queue, contentType string, mandatory, immediate bool, message *[]byte, ...) error
- func (conn *RabbitMqConnect) PublishMessageWithRouteKey(exchange, routeKey, contentType string, mandatory, immediate bool, ...) error
- func (conn *RabbitMqConnect) QueueBind(name, key, exchange string, noWait bool, arguments amqp.Table) error
- type Worker
- func (worker *Worker) GetArguments() map[string]string
- func (worker *Worker) GetChannel() *amqp.Channel
- func (worker *Worker) GetDelayQueue() string
- func (worker *Worker) GetDurable() bool
- func (worker *Worker) GetExchange() string
- func (worker *Worker) GetExchangeType() string
- func (worker *Worker) GetFailedQueue() string
- func (worker *Worker) GetLog() string
- func (worker *Worker) GetLogFolder() string
- func (worker *Worker) GetName() string
- func (worker *Worker) GetOptions() map[string]string
- func (worker *Worker) GetQueue() string
- func (worker *Worker) GetRabbitMqConnect() *RabbitMqConnect
- func (worker *Worker) GetRetryQueue() string
- func (worker *Worker) GetRoutingKey() string
- func (worker *Worker) GetThreads() int
- func (worker *Worker) InitLogger()
- func (worker *Worker) IsChannelClosed() bool
- func (worker *Worker) IsReady() bool
- func (worker *Worker) LogDebug(text ...interface{})
- func (worker *Worker) LogError(text ...interface{})
- func (worker *Worker) LogInfo(text ...interface{})
- func (worker *Worker) Perform(message interface{})
- func (worker *Worker) Recycle()
- func (worker *Worker) Retry(d *amqp.Delivery) (err error)
- func (worker *Worker) SetChannel(channel *amqp.Channel)
- func (worker *Worker) SetRabbitMqConnect(rabbitMqConnect *RabbitMqConnect)
- func (worker *Worker) Start()
- func (worker *Worker) Stop()
- func (worker *Worker) Work(body *[]byte) (err error)
- type WorkerI
Constants ¶
View Source
const (
DefaultLog = "logs/workers.log"
)
Variables ¶
This section is empty.
Functions ¶
func SubscribeMessageByQueue ¶
Types ¶
type RabbitMqConnect ¶
type RabbitMqConnect struct {
*amqp.Connection
}
func (*RabbitMqConnect) DeclareExchange ¶
func (*RabbitMqConnect) DeclareQueue ¶
func (*RabbitMqConnect) PublishMessageToQueue ¶
func (*RabbitMqConnect) PublishMessageWithRouteKey ¶
type Worker ¶
type Worker struct { Name string `yaml:"name"` Exchange string `yaml:"exchange"` ExchangeType string `yaml:"exchange_type"` RoutingKey string `yaml:"routing_key"` Queue string `yaml:"queue"` Log string `yaml:"log"` Durable bool `yaml:"durable"` Options map[string]string `yaml:"options"` Arguments map[string]string `yaml:"arguments"` Threads int `yaml:"threads"` Ready bool Logger *log.Logger // contains filtered or unexported fields }
func (*Worker) GetArguments ¶
func (*Worker) GetChannel ¶ added in v3.0.11
func (*Worker) GetDelayQueue ¶ added in v3.0.2
func (*Worker) GetDurable ¶
func (*Worker) GetExchange ¶
func (*Worker) GetExchangeType ¶
func (*Worker) GetFailedQueue ¶
func (*Worker) GetLogFolder ¶
func (*Worker) GetOptions ¶
func (*Worker) GetRabbitMqConnect ¶ added in v3.0.4
func (worker *Worker) GetRabbitMqConnect() *RabbitMqConnect
func (*Worker) GetRetryQueue ¶
func (*Worker) GetRoutingKey ¶
func (*Worker) GetThreads ¶
func (*Worker) InitLogger ¶
func (worker *Worker) InitLogger()
func (*Worker) IsChannelClosed ¶ added in v3.1.0
func (*Worker) SetChannel ¶ added in v3.0.11
func (*Worker) SetRabbitMqConnect ¶ added in v3.0.3
func (worker *Worker) SetRabbitMqConnect(rabbitMqConnect *RabbitMqConnect)
type WorkerI ¶
type WorkerI interface { Work(*[]byte) error GetName() string GetExchange() string GetExchangeType() string GetRoutingKey() string GetQueue() string GetDelayQueue() string GetRetryQueue() string GetFailedQueue() string GetLog() string GetLogFolder() string GetDurable() bool GetOptions() map[string]string GetArguments() map[string]string GetThreads() int GetRabbitMqConnect() *RabbitMqConnect SetRabbitMqConnect(*RabbitMqConnect) GetChannel() *amqp.Channel SetChannel(channel *amqp.Channel) InitLogger() Perform(interface{}) Retry(d *amqp.Delivery) (err error) IsChannelClosed() bool IsReady() bool Start() Stop() Recycle() }
Click to show internal directories.
Click to hide internal directories.