Documentation ¶
Overview ¶
DBDeployer - The MySQL Sandbox Copyright © 2006-2020 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
- Variables
- func CallFuncName() string
- func DefaultsToMap() common.StringMap
- func DeleteFromCatalog(sbName string) error
- func LoadConfiguration()
- func RemoveDefaultsFile()
- func ResetDefaults()
- func ShowDefaults(defaults DbdeployerDefaults)
- func UpdateCatalog(sbName string, details SandboxItem) error
- func UpdateDefaults(label, value string, storeDefaults bool)
- func ValidateDefaults(nd DbdeployerDefaults) bool
- func WriteDefaultsFile(filename string, defaults DbdeployerDefaults)
- type DbdeployerDefaults
- type Logger
- type SandboxCatalog
- type SandboxItem
Constants ¶
Variables ¶
var ( ConfigurationDir string = path.Join(homeDir, ConfigurationDirName) ConfigurationFile string = path.Join(ConfigurationDir, ConfigurationFileName) ArchivesFile string = path.Join(ConfigurationDir, ArchivesFileName) CustomConfigurationFile string = "" SandboxRegistry string = path.Join(ConfigurationDir, SandboxRegistryName) SandboxRegistryLock string = path.Join(common.GlobalTempDir(), SandboxRegistryLockName) LogSBOperations bool = common.IsEnvSet("DBDEPLOYER_LOGGING") )
Functions ¶
func CallFuncName ¶
func CallFuncName() string
func DefaultsToMap ¶ added in v1.30.0
Converts the defaults to a string map, useful to access single values from other operations
func DeleteFromCatalog ¶
Safe deletion of a catalog entry
func LoadConfiguration ¶
func LoadConfiguration()
func RemoveDefaultsFile ¶
func RemoveDefaultsFile()
func ResetDefaults ¶ added in v1.39.0
func ResetDefaults()
func ShowDefaults ¶
func ShowDefaults(defaults DbdeployerDefaults)
func UpdateCatalog ¶
func UpdateCatalog(sbName string, details SandboxItem) error
Safe update of the catalog, protected by a lock
func UpdateDefaults ¶
func ValidateDefaults ¶
func ValidateDefaults(nd DbdeployerDefaults) bool
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"` ShellPath string `json:"shell-path"` 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"` 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"` ImportedSandboxPrefix string `json:"imported-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"` RemoteCompletionUrl string `json:"remote-completion-url"` RemoteTarballUrl string `json:"remote-tarball-url"` PxcPrefix string `json:"pxc-prefix"` NdbPrefix string `json:"ndb-prefix"` DefaultSandboxExecutable string `json:"default-sandbox-executable"` DownloadNameLinux string `json:"download-name-linux"` DownloadNameMacOs string `json:"download-name-macos"` DownloadUrl string `json:"download-url"` Timestamp string `json:"timestamp"` }
func Defaults ¶
func Defaults() DbdeployerDefaults
func ReadDefaultsFile ¶
func ReadDefaultsFile(filename string) (defaults DbdeployerDefaults)
type SandboxCatalog ¶
type SandboxCatalog map[string]SandboxItem
func ReadCatalog ¶
func ReadCatalog() (sc SandboxCatalog, err error)
Reads the catalog, making sure that there are no concurrent operations
type SandboxItem ¶
type SandboxItem struct { Origin string `json:"origin"` SBType string `json:"type"` // single multi master-slave group all-masters fan-in ndb pxc Version string `json:"version"` Flavor string `json:"flavor,omitempty"` Host string `json:"host,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"` }