Documentation ¶
Index ¶
- func Compress(data []byte) ([]byte, error)
- func Decompress(compressed []byte) ([]byte, error)
- type Config
- type LogWriter
- type MQWrapper
- func (w *MQWrapper) Close() error
- func (w *MQWrapper) Open(wrapperId string, conf *Config) error
- func (w *MQWrapper) Post(actionKey int32, msg []byte, retry int) error
- func (w *MQWrapper) RegistActionHandler(actionKey int32, f MsgHandler) error
- func (w *MQWrapper) SetEncoder(e MsgEncoder)
- func (w *MQWrapper) ValidateConf(conf *Config) error
- type MsgEncoder
- type MsgHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decompress ¶
Types ¶
type Config ¶
type Config struct { // Ready 协调各组件之间的状态,当一切就绪之后,Ready将可读,此时该组件开始对外释放能力 Ready <-chan struct{} MQUrl string // 生产者配置 EnableProducer bool ProducerExchange string ProducerExchangeKind string ProducerQueue string ProducerRouteKey string // 消费者配置 EnableConsumer bool ConsumerExchange string ConsumerExchangeKind string ConsumerQueue string ConsumerRouteKey string // 日志写入,如果为空将不记录日志 Debug LogWriter Info LogWriter Warn LogWriter Error LogWriter }
type MQWrapper ¶
type MQWrapper struct {
// contains filtered or unexported fields
}
func (*MQWrapper) RegistActionHandler ¶
func (w *MQWrapper) RegistActionHandler(actionKey int32, f MsgHandler) error
func (*MQWrapper) SetEncoder ¶
func (w *MQWrapper) SetEncoder(e MsgEncoder)
func (*MQWrapper) ValidateConf ¶
type MsgEncoder ¶
type MsgEncoder interface { Encode(actionKey int32, msgBody []byte) ([]byte, error) Decode(b []byte) (actionKey int32, msgBody []byte, err error) }
func DefaultEncoder ¶
func DefaultEncoder() MsgEncoder
type MsgHandler ¶
Click to show internal directories.
Click to hide internal directories.