Versions in this module Expand all Collapse all v1 v1.0.0 Mar 28, 2023 Changes in this version + const ReplicationConfigDir + func GetFnvHash(key string) int32 + func NewBatchReplicator(r *replicator, batchSize int) *batchReplicator + func NewReplicator(conf *config.ReplicationConfig, kafka *config.KafkaConfig) (*replicator, error) + type MetaMessageType byte + const MetaStart + const MetaStop + type ProduceResponse struct + Offset int64 + Partition int32 + type Producer struct + func NewProducer(conf *config.Config) (*Producer, error) + func (p *Producer) Close() + func (p *Producer) GetNumPartitions(topic string) (int32, error) + func (p *Producer) ProduceMessageWithReplication(topic, key, value string, partition int32, partitionMethod string) (*ProduceResponse, error) + func (p *Producer) ProduceMessageWithoutReplication(topic, key, value string, partition int32) (*ProduceResponse, error) + func (p *Producer) SelectPartition(topic, key, partitionMethod string) (partition int32, err error) + type ReplicatedMessage struct + BatchId string + DstDatacenter string + Key []byte + MetaMessage *ReplicationMetaMessage + MsgID string + Partition int32 + PartitionMethod string + SrcDatacenter string + Topic string + Value []byte + type ReplicationMetaMessage struct + CheckSum string + Total int + Type MetaMessageType + type Replicator interface + Allow func(topic string) bool + Close func() + Replicate func(msg *ReplicatedMessage) error + Setup func(producer *Producer)