dbconfigs

package
v0.0.0-...-685946b Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2013 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package dbconfigs is reusable by vt tools to load the db configs file.

Index

Constants

This section is empty.

Variables

View Source
var DefaultDBConfigs = DBConfigs{
	App:  DBConfig{ConnectionParams: mysql.ConnectionParams{Uname: "vt_app", Charset: "utf8"}},
	Dba:  mysql.ConnectionParams{Uname: "vt_dba", Charset: "utf8"},
	Repl: mysql.ConnectionParams{Uname: "vt_repl", Charset: "utf8"},
}

Offer a default config.

Functions

func GetSubprocessFlags

func GetSubprocessFlags() []string

func RegisterAppFlags

func RegisterAppFlags(defaultDBConfig DBConfig) *string

func RegisterCommonFlags

func RegisterCommonFlags() *string

Types

type DBConfig

type DBConfig struct {
	mysql.ConnectionParams
	Keyspace string `json:"keyspace"`
	Shard    string `json:"shard"`
}

func (DBConfig) MysqlParams

func (d DBConfig) MysqlParams() mysql.ConnectionParams

func (DBConfig) Redacted

func (d DBConfig) Redacted() DBConfig

func (DBConfig) String

func (d DBConfig) String() string

type DBConfigs

type DBConfigs struct {
	App  DBConfig               `json:"app"`
	Dba  mysql.ConnectionParams `json:"dba"`
	Repl mysql.ConnectionParams `json:"repl"`
}

func Init

func Init(socketFile, dbCredentialsFile string) (DBConfigs, error)

func (DBConfigs) Redacted

func (dbcfgs DBConfigs) Redacted() DBConfigs

func (DBConfigs) String

func (dbcfgs DBConfigs) String() string

Jump to

Keyboard shortcuts

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