Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsumeListener ¶
type ConsumeListener interface { // PrepareConsume does something before data is handled by your handler logic PrepareConsume(ctx context.Context, topic string, msg *model.Msg, err error) // OnConsumeSucceed does something after data is handled by your handler logic successfully OnConsumeSucceed(ctx context.Context, topic string, msg *model.Msg) // OnConsumeFail does something when data is failed to handled by your handler logic OnConsumeFail(ctx context.Context, topic string, msg *model.Msg, err error) }
type ProducerListener ¶
type ProducerListener interface { // PrepareSend does something before msg is sent PrepareSend(ctx context.Context, topic string, msg *model.Msg, err error) // OnSendSucceed does something after msg is sent successfully OnSendSucceed(ctx context.Context, topic string, msg *model.Msg) // OnSendFail does something when msg is failed to be sent OnSendFail(ctx context.Context, topic string, msg *model.Msg, err error) }
type SnowflakeCreator ¶
type SnowflakeCreator struct {
// contains filtered or unexported fields
}
func NewSnowflakeCreator ¶
func NewSnowflakeCreator(node int64) *SnowflakeCreator
func (*SnowflakeCreator) Create ¶
func (s *SnowflakeCreator) Create() string
Click to show internal directories.
Click to hide internal directories.