Documentation
¶
Index ¶
- Variables
- type AckModeType
- type Option
- func SerializeWithJSON() Option
- func SerializeWithMsgpack() Option
- func WithBlockTime(d time.Duration) Option
- func WithClientID(clientID uint16) Option
- func WithStreamComsumerAckMode(ack AckModeType) Option
- func WithStreamComsumerGroupName(groupname string) Option
- func WithStreamComsumerRecvBatchSize(size int64) Option
- func WithStreamComsumerStartAt(t time.Time) Option
- func WithStreamComsumerStartAtID(id string) Option
- func WithUUIDSonyflake() Option
- func WithUUIDv4() Option
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var Defaultopt = Options{ SerializeProtocol: "JSON", ClientID: randomkey.GetMachineID(), UUIDType: "sonyflake", BlockTime: 1000 * time.Millisecond, RecvBatchSize: 1, Group: "", AckMode: AckModeAckWhenGet, Start: "", }
View Source
var ErrUnSupportSerializeProtocol = errors.New("未支持的序列化协议")
ErrUnSupportSerializeProtocol 未支持的序列化协议
Functions ¶
This section is empty.
Types ¶
type AckModeType ¶
type AckModeType uint16
AckModeType stream的Ack模式
const ( //AckModeAckWhenGet 获取到后确认 AckModeAckWhenGet AckModeType = iota //AckModeAckWhenDone 处理完后确认 AckModeAckWhenDone //AckModeNoAck 不做确认,消费者需要自己实现ack操作,最好别这么用 AckModeNoAck )
type Option ¶
type Option interface {
Apply(*Options)
}
Option configures how we set up the connection.
func SerializeWithMsgpack ¶
func SerializeWithMsgpack() Option
SerializeWithMsgpack 使用JSON作为序列化反序列化的协议
func WithStreamComsumerAckMode ¶
func WithStreamComsumerAckMode(ack AckModeType) Option
WithStreamComsumerAckMode stream消费者专用,用于设定同步校验规则
func WithStreamComsumerGroupName ¶
WithStreamComsumerGroupName stream消费者专用,用于设定客户端组
func WithStreamComsumerRecvBatchSize ¶
WithStreamComsumerRecvBatchSize stream消费者专用,用于设定一次获取的消息批长度
func WithStreamComsumerStartAt ¶
WithStreamComsumerAckMode stream消费者专用,用于设定同步校验规则
func WithStreamComsumerStartAtID ¶
WithStreamComsumerAckMode stream消费者专用,用于设定同步校验规则
type Options ¶
type Options struct { SerializeProtocol string ClientID uint16 UUIDType string BlockTime time.Duration //stream和queue结构使用的参数,用于设置每次拉取的阻塞时长 RecvBatchSize int64 //stream消费者专用,用于设定一次获取的消息批长度 Group string //stream消费者专用,用于设定客户端组 AckMode AckModeType //stream消费者专用,用于设定同步校验规则 Start string //stream消费者专用,用于设定监听的起始位置,"则从最近的开始监听" }
Options broker的配置
Directories
¶
Path | Synopsis |
---|---|
Package 发布订阅器对象 Package pubsub 发布订阅器对象 非常适合作为简单的广播模式的中间件
|
Package 发布订阅器对象 Package pubsub 发布订阅器对象 非常适合作为简单的广播模式的中间件 |
Package queue 队列对象 非常适合作为简单的生产者消费者模式的中间件 Package queue 队列对象 非常适合作为简单的生产者消费者模式的中间件 Package queue 队列对象 非常适合作为简单的生产者消费者模式的中间件
|
Package queue 队列对象 非常适合作为简单的生产者消费者模式的中间件 Package queue 队列对象 非常适合作为简单的生产者消费者模式的中间件 Package queue 队列对象 非常适合作为简单的生产者消费者模式的中间件 |
Package stream 流及相关对象的包 Package stream 流及相关对象的包
|
Package stream 流及相关对象的包 Package stream 流及相关对象的包 |
Click to show internal directories.
Click to hide internal directories.