defaults

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2019 License: Apache-2.0 Imports: 12 Imported by: 7

Documentation

Overview

DBDeployer - The MySQL Sandbox Copyright © 2006-2018 Giuseppe Maxia

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	ConfigurationDirName    string = ".dbdeployer"
	ConfigurationFileName   string = "config.json"
	SandboxRegistryName     string = "sandboxes.json"
	SandboxRegistryLockName string = "sandboxes.lock"
)

Variables

View Source
var (
	ConfigurationDir        string = path.Join(homeDir, ConfigurationDirName)
	ConfigurationFile       string = path.Join(ConfigurationDir, ConfigurationFileName)
	CustomConfigurationFile string = ""
	SandboxRegistry         string = path.Join(ConfigurationDir, SandboxRegistryName)
	SandboxRegistryLock     string = path.Join(ConfigurationDir, SandboxRegistryLockName)
	LogSBOperations         bool   = common.IsEnvSet("DBDEPLOYER_LOGGING")
)

Functions

func CallFuncName

func CallFuncName() string

func DeleteFromCatalog

func DeleteFromCatalog(sbName string) error

func LoadConfiguration

func LoadConfiguration()

func RemoveDefaultsFile

func RemoveDefaultsFile()

func ShowDefaults

func ShowDefaults(defaults DbdeployerDefaults)

func UpdateCatalog

func UpdateCatalog(sbName string, details SandboxItem) error

func UpdateDefaults

func UpdateDefaults(label, value string, storeDefaults bool)

func ValidateDefaults

func ValidateDefaults(nd DbdeployerDefaults) bool

func WriteCatalog

func WriteCatalog(sc SandboxCatalog) error

func WriteDefaultsFile

func WriteDefaultsFile(filename string, defaults DbdeployerDefaults)

Types

type DbdeployerDefaults

type DbdeployerDefaults struct {
	Version           string `json:"version"`
	SandboxHome       string `json:"sandbox-home"`
	SandboxBinary     string `json:"sandbox-binary"`
	UseSandboxCatalog bool   `json:"use-sandbox-catalog"`
	LogSBOperations   bool   `json:"log-sb-operations"`
	LogDirectory      string `json:"log-directory"`
	CookbookDirectory string `json:"cookbook-directory"`

	//UseConcurrency    			   bool   `json:"use-concurrency"`
	MasterSlaveBasePort           int `json:"master-slave-base-port"`
	GroupReplicationBasePort      int `json:"group-replication-base-port"`
	GroupReplicationSpBasePort    int `json:"group-replication-sp-base-port"`
	FanInReplicationBasePort      int `json:"fan-in-replication-base-port"`
	AllMastersReplicationBasePort int `json:"all-masters-replication-base-port"`
	MultipleBasePort              int `json:"multiple-base-port"`
	// GaleraBasePort                 int    `json:"galera-base-port"`
	PxcBasePort       int    `json:"pxc-base-port"`
	NdbBasePort       int    `json:"ndb-base-port"`
	NdbClusterPort    int    `json:"ndb-cluster-port"`
	GroupPortDelta    int    `json:"group-port-delta"`
	MysqlXPortDelta   int    `json:"mysqlx-port-delta"`
	AdminPortDelta    int    `json:"admin-port-delta"`
	MasterName        string `json:"master-name"`
	MasterAbbr        string `json:"master-abbr"`
	NodePrefix        string `json:"node-prefix"`
	SlavePrefix       string `json:"slave-prefix"`
	SlaveAbbr         string `json:"slave-abbr"`
	SandboxPrefix     string `json:"sandbox-prefix"`
	MasterSlavePrefix string `json:"master-slave-prefix"`
	GroupPrefix       string `json:"group-prefix"`
	GroupSpPrefix     string `json:"group-sp-prefix"`
	MultiplePrefix    string `json:"multiple-prefix"`
	FanInPrefix       string `json:"fan-in-prefix"`
	AllMastersPrefix  string `json:"all-masters-prefix"`
	ReservedPorts     []int  `json:"reserved-ports"`
	RemoteRepository  string `json:"remote-repository"`
	RemoteIndexFile   string `json:"remote-index-file"`
	// GaleraPrefix                   string `json:"galera-prefix"`
	PxcPrefix string `json:"pxc-prefix"`
	NdbPrefix string `json:"ndb-prefix"`
	Timestamp string `json:"timestamp"`
}

func Defaults

func Defaults() DbdeployerDefaults

func ReadDefaultsFile

func ReadDefaultsFile(filename string) (defaults DbdeployerDefaults)

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(logDir, logFileName string) (*Logger, string, error)

func (*Logger) Printf

func (l *Logger) Printf(format string, args ...interface{})

Calling Logger.Printf will print what was requested, with an additional prefix made of :

  • dbdeployer Process ID
  • the current operation number
  • the name of the caller function

type SandboxCatalog

type SandboxCatalog map[string]SandboxItem

func ReadCatalog

func ReadCatalog() (sc SandboxCatalog, err error)

type SandboxItem

type SandboxItem struct {
	Origin            string   `json:"origin"`
	SBType            string   `json:"type"` // single multi master-slave group all-masters fan-in
	Version           string   `json:"version"`
	Flavor            string   `json:"flavor,omitempty"`
	Port              []int    `json:"port"`
	Nodes             []string `json:"nodes"`
	Destination       string   `json:"destination"`
	DbDeployerVersion string   `json:"dbdeployer-version"`
	Timestamp         string   `json:"timestamp"`
	LogDirectory      string   `json:"log-directory,omitempty"`
	CommandLine       string   `json:"command-line"`
}

Jump to

Keyboard shortcuts

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