Documentation ¶
Index ¶
- Constants
- func NewKafkaChannel(conf interface{}) (core.IChannel, error)
- func NewNatsChannel(conf interface{}) (core.IChannel, error)
- type KafkaChannel
- func (c *KafkaChannel) Close()
- func (c *KafkaChannel) Commit(rawMsgs []interface{}) error
- func (c *KafkaChannel) GetDir() int
- func (c *KafkaChannel) GetID() string
- func (c *KafkaChannel) Init(logPorf bool)
- func (c *KafkaChannel) PreStart(broker string, statsInterval int)
- func (c *KafkaChannel) Send(topic string, partition int32, keys, bytes []byte, headers map[string]string) error
- func (c *KafkaChannel) SendAndRecv(topic string, partition int32, keys, bytes []byte, headers map[string]string) error
- func (c *KafkaChannel) SendAndRecvWithRetry(topic string, partition int32, keys, bytes []byte, headers map[string]string) error
- func (c *KafkaChannel) SendRecv(topic string, bytes []byte, timeout int, headers map[string]string) ([]byte, error)
- func (c *KafkaChannel) SendWithRetry(topic string, partition int32, keys, bytes []byte, headers map[string]string) error
- func (c *KafkaChannel) SetChan(slot uint32, chanSize int)
- func (c *KafkaChannel) SetDir(dir int)
- func (c *KafkaChannel) SetGroup(group string)
- func (c *KafkaChannel) SetHandler(handler core.IChannelConsumer)
- func (c *KafkaChannel) SetID(id string)
- func (c *KafkaChannel) SetTopic(topic string)
- func (c *KafkaChannel) Start()
- func (c *KafkaChannel) Stop()
- func (c *KafkaChannel) SubscribeTopic(topic string) error
- type KafkaConsumerConf
- type KafkaProducerConf
- type NatsChannel
- func (c *NatsChannel) Close()
- func (c *NatsChannel) Commit(rawMsg []interface{}) error
- func (c *NatsChannel) GetDir() int
- func (c *NatsChannel) GetID() string
- func (c *NatsChannel) Init(logPorf bool)
- func (c *NatsChannel) PreStart(broker string, statsInterval int)
- func (c *NatsChannel) Send(topic string, partition int32, keys, bytes []byte, headers map[string]string) error
- func (c *NatsChannel) SendAndRecv(topic string, partition int32, keys, bytes []byte, headers map[string]string) error
- func (c *NatsChannel) SendAndRecvWithRetry(topic string, partition int32, keys, bytes []byte, headers map[string]string) error
- func (c *NatsChannel) SendRecv(topic string, bytes []byte, timeout int, headers map[string]string) ([]byte, error)
- func (c *NatsChannel) SendWithRetry(topic string, partition int32, keys, bytes []byte, headers map[string]string) error
- func (c *NatsChannel) SetConn(conn *nats.Conn)
- func (c *NatsChannel) SetDir(dir int)
- func (c *NatsChannel) SetGroup(group string)
- func (c *NatsChannel) SetHandler(handler core.IChannelConsumer)
- func (c *NatsChannel) SetID(id string)
- func (c *NatsChannel) SetTopic(topic string)
- func (c *NatsChannel) Start()
- func (c *NatsChannel) Stop()
Constants ¶
View Source
const ( DefaultTimeOut = 10 DefaultEnableAutoCommit = true )
Variables ¶
This section is empty.
Functions ¶
func NewKafkaChannel ¶
func NewNatsChannel ¶
Types ¶
type KafkaChannel ¶
type KafkaChannel struct {
// contains filtered or unexported fields
}
func (*KafkaChannel) Close ¶
func (c *KafkaChannel) Close()
func (*KafkaChannel) Commit ¶
func (c *KafkaChannel) Commit(rawMsgs []interface{}) error
func (*KafkaChannel) GetDir ¶
func (c *KafkaChannel) GetDir() int
func (*KafkaChannel) GetID ¶
func (c *KafkaChannel) GetID() string
func (*KafkaChannel) Init ¶
func (c *KafkaChannel) Init(logPorf bool)
func (*KafkaChannel) PreStart ¶
func (c *KafkaChannel) PreStart(broker string, statsInterval int)
func (*KafkaChannel) Send ¶
func (c *KafkaChannel) Send(topic string, partition int32, keys, bytes []byte, headers map[string]string) error
异步发送消息
func (*KafkaChannel) SendAndRecv ¶
func (c *KafkaChannel) SendAndRecv(topic string, partition int32, keys, bytes []byte, headers map[string]string) error
同步发送消息
func (*KafkaChannel) SendAndRecvWithRetry ¶
func (c *KafkaChannel) SendAndRecvWithRetry(topic string, partition int32, keys, bytes []byte, headers map[string]string) error
同步发送消息失败重试
func (*KafkaChannel) SendRecv ¶
func (c *KafkaChannel) SendRecv(topic string, bytes []byte, timeout int, headers map[string]string) ([]byte, error)
nats methed interface
func (*KafkaChannel) SendWithRetry ¶
func (c *KafkaChannel) SendWithRetry(topic string, partition int32, keys, bytes []byte, headers map[string]string) error
异步发送消息失败重试
func (*KafkaChannel) SetChan ¶
func (c *KafkaChannel) SetChan(slot uint32, chanSize int)
func (*KafkaChannel) SetDir ¶
func (c *KafkaChannel) SetDir(dir int)
func (*KafkaChannel) SetGroup ¶
func (c *KafkaChannel) SetGroup(group string)
func (*KafkaChannel) SetHandler ¶
func (c *KafkaChannel) SetHandler(handler core.IChannelConsumer)
func (*KafkaChannel) SetID ¶
func (c *KafkaChannel) SetID(id string)
func (*KafkaChannel) SetTopic ¶
func (c *KafkaChannel) SetTopic(topic string)
func (*KafkaChannel) Start ¶
func (c *KafkaChannel) Start()
func (*KafkaChannel) Stop ¶
func (c *KafkaChannel) Stop()
func (*KafkaChannel) SubscribeTopic ¶
func (c *KafkaChannel) SubscribeTopic(topic string) error
type KafkaConsumerConf ¶
type KafkaProducerConf ¶
type KafkaProducerConf interface {
LingerMsConf() *string
}
type NatsChannel ¶
type NatsChannel struct {
// contains filtered or unexported fields
}
func (*NatsChannel) Close ¶
func (c *NatsChannel) Close()
func (*NatsChannel) Commit ¶
func (c *NatsChannel) Commit(rawMsg []interface{}) error
func (*NatsChannel) GetDir ¶
func (c *NatsChannel) GetDir() int
func (*NatsChannel) GetID ¶
func (c *NatsChannel) GetID() string
func (*NatsChannel) Init ¶
func (c *NatsChannel) Init(logPorf bool)
func (*NatsChannel) PreStart ¶
func (c *NatsChannel) PreStart(broker string, statsInterval int)
func (*NatsChannel) SendAndRecv ¶
func (*NatsChannel) SendAndRecvWithRetry ¶
func (*NatsChannel) SendWithRetry ¶
func (*NatsChannel) SetConn ¶
func (c *NatsChannel) SetConn(conn *nats.Conn)
func (*NatsChannel) SetDir ¶
func (c *NatsChannel) SetDir(dir int)
func (*NatsChannel) SetGroup ¶
func (c *NatsChannel) SetGroup(group string)
func (*NatsChannel) SetHandler ¶
func (c *NatsChannel) SetHandler(handler core.IChannelConsumer)
func (*NatsChannel) SetID ¶
func (c *NatsChannel) SetID(id string)
func (*NatsChannel) SetTopic ¶
func (c *NatsChannel) SetTopic(topic string)
func (*NatsChannel) Start ¶
func (c *NatsChannel) Start()
func (*NatsChannel) Stop ¶
func (c *NatsChannel) Stop()
Click to show internal directories.
Click to hide internal directories.