config

package
v0.0.0-...-2e99afd Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2015 License: MIT Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addr     string `yaml:"addr"`
	User     string `yaml:"user"`
	Password string `yaml:"password"`
	LogLevel string `yaml:"log_level"`

	Nodes []NodeConfig `yaml:"nodes"`

	Schemas []SchemaConfig `yaml:"schemas"`
}

func ParseConfigData

func ParseConfigData(data []byte) (*Config, error)

func ParseConfigFile

func ParseConfigFile(fileName string) (*Config, error)

type NodeConfig

type NodeConfig struct {
	Name             string `yaml:"name"`
	DownAfterNoAlive int    `yaml:"down_after_noalive"`
	IdleConns        int    `yaml:"idle_conns"`
	RWSplit          bool   `yaml:"rw_split"`

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

	Master string `yaml:"master"`
	Slave  string `yaml:"slave"`
}

type RulesConfig

type RulesConfig struct {
	Default   string        `yaml:"default"`
	ShardRule []ShardConfig `yaml:"shard"`
}

type SchemaConfig

type SchemaConfig struct {
	DB          string      `yaml:"db"`
	Nodes       []string    `yaml:"nodes"`
	RulesConifg RulesConfig `yaml:"rules"`
}

type ShardConfig

type ShardConfig struct {
	Table string   `yaml:"table"`
	Key   string   `yaml:"key"`
	Nodes []string `yaml:"nodes"`
	Type  string   `yaml:"type"`
	Range string   `yaml:"range"`
}

Jump to

Keyboard shortcuts

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