Documentation ¶
Index ¶
- func Publish(ctx context.Context, argument PublishArgument) (ok bool, err errors.CodeError)
- func RegisterConsumerHandler(name string, builder ConsumerHandlerBuilder)
- func Service() service.Service
- type ClientTLSConfig
- type Config
- type Consumer
- type ConsumerConfig
- type ConsumerHandler
- type ConsumerHandlerBuilder
- type ConsumerHandlerOptions
- type ConsumerMessage
- type DefaultConsumerMessage
- func (msg *DefaultConsumerMessage) Ack() (err error)
- func (msg *DefaultConsumerMessage) Body() (body []byte)
- func (msg *DefaultConsumerMessage) ContentType() (contentType string)
- func (msg *DefaultConsumerMessage) Id() (id string)
- func (msg *DefaultConsumerMessage) Raw() (raw *amqp.Delivery)
- func (msg *DefaultConsumerMessage) Reject() (err error)
- func (msg *DefaultConsumerMessage) Type() (typ string)
- type Message
- type OptionsConfig
- type Producer
- type ProducerConfig
- type ProducerMessage
- type PublishArgument
- type PublishResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterConsumerHandler ¶
func RegisterConsumerHandler(name string, builder ConsumerHandlerBuilder)
Types ¶
type ClientTLSConfig ¶
type Config ¶
type Config struct { URI string `json:"uri"` Options *OptionsConfig `json:"options"` Producers map[string]*ProducerConfig `json:"producers"` Consumers map[string]*ConsumerConfig `json:"consumers"` }
type ConsumerConfig ¶
type ConsumerConfig struct { Handler string `json:"handler"` HandlerOptions json.RawMessage `json:"handlerOptions"` Queue string `json:"queue"` AutoAck bool `json:"autoAck"` Exclusive bool `json:"exclusive"` NoLocal bool `json:"noLocal"` NoWait bool `json:"noWait"` Arguments map[string]interface{} `json:"arguments"` }
type ConsumerHandler ¶
type ConsumerHandler interface {
Handle(ctx context.Context, message ConsumerMessage)
}
type ConsumerHandlerBuilder ¶
type ConsumerHandlerBuilder func(options ConsumerHandlerOptions) (handler ConsumerHandler, err error)
type ConsumerHandlerOptions ¶
type ConsumerHandlerOptions struct { Log logs.Logger Config configures.Config }
type ConsumerMessage ¶
type DefaultConsumerMessage ¶
type DefaultConsumerMessage struct {
// contains filtered or unexported fields
}
func (*DefaultConsumerMessage) Ack ¶
func (msg *DefaultConsumerMessage) Ack() (err error)
func (*DefaultConsumerMessage) Body ¶
func (msg *DefaultConsumerMessage) Body() (body []byte)
func (*DefaultConsumerMessage) ContentType ¶
func (msg *DefaultConsumerMessage) ContentType() (contentType string)
func (*DefaultConsumerMessage) Id ¶
func (msg *DefaultConsumerMessage) Id() (id string)
func (*DefaultConsumerMessage) Raw ¶
func (msg *DefaultConsumerMessage) Raw() (raw *amqp.Delivery)
func (*DefaultConsumerMessage) Reject ¶
func (msg *DefaultConsumerMessage) Reject() (err error)
func (*DefaultConsumerMessage) Type ¶
func (msg *DefaultConsumerMessage) Type() (typ string)
type Message ¶
type Message struct { Service string `json:"service"` Fn string `json:"fn"` Argument json.RawMessage `json:"argument"` }
type OptionsConfig ¶
type OptionsConfig struct { AMQPlainAuth *amqp.AMQPlainAuth `json:"amqPlainAuth"` Vhost string `json:"vhost"` ChannelMax int `json:"channelMax"` FrameSize int `json:"frameSize"` HeartbeatSeconds int `json:"heartbeatSeconds"` Locale string `json:"locale"` ClientTLS *ClientTLSConfig `json:"clientTLS"` }
type ProducerConfig ¶
type ProducerMessage ¶
type PublishArgument ¶
type PublishArgument struct { Name string `json:"name"` Body json.RawMessage `json:"body"` }
type PublishResult ¶
type PublishResult struct {
Succeed bool `json:"succeed"`
}
Click to show internal directories.
Click to hide internal directories.