config

package
v0.0.0-...-b4c1251 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssociatedTableConfig

type AssociatedTableConfig struct {
	ReferenceCol       string `yaml:"reference_col"` //主表列
	ReferenceTableName string `yaml:"reference_table_name"`
	Fk                 string `yaml:"fk"`
}

type Config

type Config struct {
	Addr     string `yaml:"addr"`
	LogLevel string `yaml:"log_level"`

	Charset           string            `yaml:"charset"`
	CollationId       mysql.CollationId `yaml:"collation_id"`
	DefaultAuthMethod string            `yaml:"default_auth_method"`

	LogPath  string       `yaml:"log_path"`
	UserList []UserConfig `yaml:"user_list"`

	NodePath   []string `yaml:"node_path"`
	NodeList   []NodeConfig
	SchemaPath []string `yaml:"schema_path"`
	SchemaList []SchemaConfig
}

func ParseConfig

func ParseConfig(path string) (*Config, error)

type NodeConfig

type NodeConfig struct {
	Name             string `yaml:"name"`
	DownAfterNoAlive int    `yaml:"down_after_noalive"`
	MaxConnsLimit    int    `yaml:"max_conns_limit"`

	User     string `yaml:"user"`
	Password string `yaml:"password"`

	Master    string   `yaml:"master"`
	SlaveList []string `yaml:"slave_list"`
}

type SchemaConfig

type SchemaConfig struct {
	NodeList   []string `yaml:"node_list"`
	SchemaName string   `yaml:"schema_name"`

	NodeCfgList []NodeConfig

	DefaultNode string `yaml:"default_node"`

	//RuleList []RuleConfig `yaml:"rule_list"`
	TableList []TableConfig `yaml:"table_list"`
}

type TableConfig

type TableConfig struct {
	TableName       string                 `yaml:"table_name"`
	Key             string                 `yaml:"key"`
	Type            string                 `yaml:"type"`
	Locations       []int                  `yaml:"locations"`
	AssociatedTable *AssociatedTableConfig `yaml:"associated_table"`
	NodeList        []string               `yaml:"node_list"`
	DefaultNode     string                 `yaml:"default_node"`
	DateRange       []string               `yaml:"date_range"`
	TableRowLimit   int                    `yaml:"table_row_limit"`
}

type UserConfig

type UserConfig struct {
	User     string `yaml:"user"`
	Password string `yaml:"password"`
}

Jump to

Keyboard shortcuts

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