Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sink ¶
type Sink struct {
// contains filtered or unexported fields
}
func (*Sink) RegisterLocal ¶
func (s *Sink) RegisterLocal(topic string, handler MsgHandleFunc)
type SinkConf ¶
type SinkConf struct {
Broker string // kafka 实例地址
KafkaUser string // 用户名
KafkaPassword string // 密码
Mechanism string // SASL的认知机制,一般是铭文PLAIN
ConsumerGroup string // 指定消费者组id
ClientID string // 客户端ID
Version string // kafka version
}
SinkConf 消费者服务配置
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
func InitSource ¶
func InitSource(config *SourceConf) (s *Source, err error)
type SourceConf ¶
type SourceConf struct {
// DBOptions *options.DBOptions
Broker string // kafka 实例地址
KafkaUser string // 用户名
KafkaPassword string // 密码
Mechanism string // SASL的认知机制,一般是铭文PLAIN
Version string // kafka的版本
ClientID string // 客户端id
RedisConfig redis.RedisConf // redis配置,为了初始化分布式锁
Sources Sources
}
SourceConf 生产者服务配置
type SyncMessage ¶
type SyncMessage struct {
GroupIds []string `json:"group_ids"` // 需要消费这条消息的消费者组
Data any `json:"data"` // 变更后的数据
DB string `json:"db"` // 数据库名称
Schema string `json:"schema"` // schema
Table string `json:"table"` // 表名称
Operation string `json:"op"` // 变更类型 u更新 c新建
TimeStamp int64 `json:"ts_ms"` // 变更时间 毫秒时间戳
}
SyncMessage kafka message的payload
Click to show internal directories.
Click to hide internal directories.