Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncSendCallback ¶
type AsyncSendCallback func(ctx context.Context, sendResponse SendResponse, err error)
type CompressionCodec ¶
type CompressionCodec int
const ( // CompressionNone no compression CompressionNone CompressionCodec = iota // CompressionZSTD compression using ZSTD CompressionZSTD )
type ConsumerConfig ¶
type ConsumerConfig struct { // Name server address Addr []string // Topic name Topic string // Consumer group name ConsumerGroup string // Whether to consume orderly Orderly bool // Consume specific tags, such as "tag" or "tag1 || tag2 || tag3" TagExpression string // Max number of messages consumed concurrently ConsumeGoroutineNums int // Timeout for consumer one message ConsumeTimeout time.Duration }
type ConsumerRegistry ¶
type ConsumerRegistry interface { Register(worker []IConsumerWorker) ConsumerRegistry StartAll(ctx context.Context) error }
type IConsumer ¶
type IConsumer interface { Start() error Close() error RegisterHandler(IConsumerHandler) }
type IConsumerHandler ¶
type IConsumerHandler interface {
HandleMessage(context.Context, *MessageExt) error
}
type IConsumerWorker ¶
type IConsumerWorker interface { ConsumerCfg(ctx context.Context) (*ConsumerConfig, error) IConsumerHandler }
type IFactory ¶
type IFactory interface { NewProducer(ProducerConfig) (IProducer, error) NewConsumer(ConsumerConfig) (IConsumer, error) }
type Message ¶
type Message struct { Topic string Body []byte Tag string PartitionKey string Properties map[string]string DeferDuration time.Duration }
func NewDeferMessage ¶
func NewMessage ¶
func NewOrderlyMessage ¶
func (*Message) WithDeferDuration ¶
func (*Message) WithPartitionKey ¶
func (*Message) WithProperties ¶
type MessageExt ¶
type ProducerConfig ¶
type SendResponse ¶
Click to show internal directories.
Click to hide internal directories.