conf

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2019 License: Apache-2.0 Imports: 0 Imported by: 4 modules, 13 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	// PgDumpExec pg_dump 可执行文件路径
	PgDumpExec string `json:"pg_dump_path"`
	// Subscribes 订阅规则
	Subscribes []*Subscribe `json:"subscribes"`
	// PrometheusAddress prometheus
	PrometheusAddress string `json:"prometheus_address"`
}

Conf ...

type ESConf

type ESConf struct {
	// Addrs es 地址
	Addrs string `json:"addrs"`
	// User es username
	User string `json:"user"`
	// Password es password
	Password string `json:"password"`
}

ESConf es 配置

type KafkaConf

type KafkaConf struct {
	// Addrs kafka集群地址
	Addrs []string `json:"addrs"`
}

KafkaConf kafka 配置

type PGConnConf

type PGConnConf struct {
	// Host 地址
	Host string `json:"host"`
	// Port 端口
	Port uint16 `json:"port"`
	// Database database
	Database string `json:"database"`
	// Schema schema
	Schema string `json:"schema"`
	// User user
	User string `json:"user"`
	// Password password
	Password string `json:"password"`
}

PGConnConf of pg

type Rule

type Rule struct {
	// Table 订阅数据表,支持 ?* 通配符匹配
	Table string `json:"table"`
	// PKs 表的主键
	PKs []string `json:"pks"`

	// 下面几项同步到es中时需配置
	// ESID 用作es中id的字段,多个字段内容会连在一起
	ESID []string `json:"esid"`
	// Index es中的idex
	Index string `json:"index"`
	// Type es中的type
	Type string `json:"type"`

	// 下面几项同步到kafka中时需要配置
	// Topic ...
	Topic string `json:"topic"`
}

Rule 同步规则

type Subscribe

type Subscribe struct {
	// Dump 创建复制槽成功后,是否 dump 历史数据
	Dump bool `json:"dump"`
	// SlotName 逻辑复制槽
	SlotName string `json:"slotName"`
	// PGConnConf pg 连接配置
	PGConnConf *PGConnConf `json:"pgConnConf"`
	// Rules 订阅规则
	Rules []*Rule `json:"rules"`
	// ESConf ES 配置
	ESConf *ESConf `json:"esConf"`
	// KafkaConf kafka 配置
	KafkaConf *KafkaConf `json:"kafkaConf"`
	// Retry 重试次数 -1:无限重试
	Retry int `json:"retry"`
}

Subscribe 订阅一个数据库中的表的wal,根据规则保存到es里相应的index,type中

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL