Documentation ¶
Index ¶
Constants ¶
View Source
const (
VERSION = "1.0.3"
)
Variables ¶
View Source
var ( Pid = path.CurrentPath + "/wing-binlog-go.pid" DEBUG = false ConfigPath = path.CurrentPath + "/config" CachePath = path.CurrentPath + "/cache" LogPath = path.CurrentPath + "/logs" )
View Source
var ( ErrorFileNotFound = errors.New("file does not exists") ErrorFileParse = errors.New("config file parse error") )
Functions ¶
func GetKey ¶
get unique key, param if file path if file does not exists, try to create it, and write a unique key return the unique key if exists, read file and return it
Types ¶
type Context ¶
type Context struct { // canal context Ctx context.Context // canal context func Cancel context.CancelFunc // pid file path PidFile string //reloadChan chan string //ShowMembersChan chan struct{} //ShowMembersRes chan string PosChan chan string //HttpConfig *HttpConfig //TcpConfig *TcpConfig MysqlConfig *MysqlConfig //ClusterConfig *ClusterConfig AppConfig *Config // contains filtered or unexported fields }
context
type MysqlConfig ¶
type MysqlConfig struct { // mysql service ip and port, like: "127.0.0.1:3306" Addr string `toml:"addr"` // mysql service user User string `toml:"user"` // mysql password Password string `toml:"password"` // mysql default charset Charset string `toml:"charset"` // mysql binlog client id, it must be unique ServerID uint32 `toml:"server_id"` // mysql or mariadb Flavor string `toml:"flavor"` // heartbeat interval, unit is ns, 30000000000 = 30s 1000000000 = 1s HeartbeatPeriod time.Duration `toml:"heartbeat_period"` // read timeout, unit is ns, 0 is never timeout, 30000000000 = 30s 1000000000 = 1s ReadTimeout time.Duration `toml:"read_timeout"` // read start form the binlog file BinFile string `toml:"bin_file"` // read start form the pos BinPos uint32 `toml:"bin_pos"` }
type TcpConfig ¶
type TcpConfig struct { Listen string `toml:"listen"` Port int `toml:"port"` Enable bool `toml:"enable"` ServiceIp string `toml:"service_ip"` Groups TcpGroupConfigs }
type TcpGroupConfig ¶
type TcpGroupConfigs ¶
type TcpGroupConfigs map[string]TcpGroupConfig
func (*TcpGroupConfigs) HasName ¶
func (cs *TcpGroupConfigs) HasName(name string) bool
Click to show internal directories.
Click to hide internal directories.