config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2020 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 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 Config

type Config struct {
	Listener  ListenerCfg  // 数据库监控器配置
	Database  DatabaseCfg  // 数据库连接配置
	Publisher PublisherCfg // 事件发布器配置
	Dumper    DumperCfg    // Dumper 配置
	Logger    LoggerCfg    // 日志配置
}

Config for pg-listener/

func (Config) Validate

func (c Config) Validate() error

Validate config data.

type DatabaseCfg

type DatabaseCfg struct {
	Host     string `valid:"required"`
	Port     uint16 `valid:"required"`
	Name     string `valid:"required"`
	User     string `valid:"required"`
	Password string `valid:"required"`
	Schema   string
	Filter   FilterStruct
}

DatabaseCfg path of the PostgreSQL DB config.

type DumperCfg added in v0.2.0

type DumperCfg struct {
	Handler string // Dump Handler: event,sql,es 默认event, 适合历史数据较少情况
	Path    string // pg_dump 路径
}

type FilterStruct

type FilterStruct struct {
	Tables map[string][]string
}

FilterStruct incoming WAL message filter.

type ListenerCfg

type ListenerCfg struct {
	SlotName          string        `valid:"required"`
	PubName           string        // 发布名称
	Dump              bool          // 是否导出复制槽快照数据
	AckTimeout        time.Duration `valid:"required"`
	RefreshConnection time.Duration `valid:"required"`
	HeartbeatInterval time.Duration `valid:"required"`
}

ListenerCfg path of the listener config.

type LoggerCfg

type LoggerCfg struct {
	Caller        bool
	Level         string
	HumanReadable bool
}

LoggerCfg path of the logger config.

type PublisherCfg

type PublisherCfg struct {
	Type        string `valid:"required"`
	Address     string `valid:"required"`
	ClusterID   string `valid:"required"`
	ClientID    string `valid:"required"`
	TopicPrefix string `valid:"required"`
}

PublisherCfg path of the evernt publisher config.

Jump to

Keyboard shortcuts

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