config

package
v0.0.0-...-948e253 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Project  项目名称
	Project = "historage"
	// NEName 网元名称
	NEName = "fusiondataprocessing"
)
View Source
var ConfigFile string

ConfigFile 配置文件绝对地址

View Source
var LogLevel string

LogLevel 日志等级

View Source
var LogPath string

LogPath 日志文件地址

View Source
var SID int

SID fusion 标识

View Source
var TargetMysqlAddr string

TargetMysqlAddr 连接的mysql地址

Functions

func PrintConf

func PrintConf(conf *FusionConfig) string

PrintConf 打印配置文件

Types

type AppConfig

type AppConfig struct {
	Port                  int    `toml:"port"`
	SaveInterval          int64  `toml:"save_position_interval"`
	FailoverMAXCheck      int    `toml:"failover_max_check"`
	Heartbeat             string `toml:"heartbeat"`
	MysqlVersion          string `toml:"mysql_version"`
	ISSyncFromSlave       int    `toml:"is_sync_from_slave"`
	ISSupportDDL          int    `toml:"is_support_ddl"`
	ISSupportDefineColumn int    `toml:"is_support_define_column"`
	MysqlSwitchType       int    `toml:"mysql_switch_type"`
	ReserveHours          int    `toml:"reserve_hours"`
	MysqlPosSaveInterval  int64  `toml:"mysql_pos_save_interval"`
	FusionStartInterval   int    `toml:"fusion_start_interval"`
}

AppConfig app 配置,端口号用于提供http服务

type FusionConfig

type FusionConfig struct {
	CanalConfig    *canal.Config          `toml:"canal"`
	RDSSlaveConfig *RDSSlaveConfig        `toml:"rds_slave"`
	DumpConfig     *canal.DumpConfig      `toml:"dump"`
	RedisConfig    *redisutil.RedisConfig `toml:"redis"`
	RuleConfig     *ruleparser.RuleConfig `toml:"rule"`
	AppConfig      *AppConfig             `toml:"app"`
	KafkaConfig    *KafkaConfig           `toml:"kafka"`
	StandbyConfig  *StandbyConfig         `toml:"standby"`
	LogConfig      *LogConfig             `toml:"log"`
}

FusionConfig config file

var ConfigInfo *FusionConfig

ConfigInfo 配置信息

func InitCfgUseFile

func InitCfgUseFile() *FusionConfig

InitCfgUseFile 加载配置文件

type KafkaConfig

type KafkaConfig struct {
	NeedKafka        int           `toml:"need_kafka"`
	DataFormat       int           `toml:"data_format"`
	BrokerList       string        `toml:"broker_list"`
	Topic            string        `toml:"topic"`
	FlushMAXMessages int           `toml:"flush_max_messages"`
	FlushFrequency   time.Duration `toml:"flush_frequency"`
	MaxRequestSize   int           `toml:"max_request_size"`
	MaxMessageBytes  int           `toml:"max_message_bytes"`
}

KafkaConfig kafka config

type LogConfig

type LogConfig struct {
	LogLevel string `toml:"level"`
}

LogConfig

type RDSSlaveConfig

type RDSSlaveConfig struct {
	Addr     string `toml:"addr"`
	User     string `toml:"user"`
	Password string `toml:"password"`
}

RDSSlaveConfig RDS只读副本配置

type StandbyConfig

type StandbyConfig struct {
	Addr     string `toml:"addr"`
	User     string `toml:"user"`
	Password string `toml:"password"`
}

StandbyConfig mysql 备库配置

Jump to

Keyboard shortcuts

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