Documentation ¶
Overview ¶
Copyright © 2020 NAME HERE <EMAIL ADDRESS>
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.
Copyright © 2020 NAME HERE <EMAIL ADDRESS>
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.
Copyright © 2020 NAME HERE <EMAIL ADDRESS>
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 ¶
const ( CommandSSH = "ssh" CommandSFTP = "sftp" DefaultSSHUser = "ubuntu" )
const ( ServiceDomain = "airdb.space" HostDomain = "airdb.host" )
const AirdbWiki = "https://airdb-wiki.github.io/"
const CloudPlatformAliyun = "aliyun"
Variables ¶
var BackupConfigFile = func(filename string) error { return os.Rename(filename, filename+".bak") }
var GlobalFlags = FlagStruct{}
var ReadConfigFile = func(filename string) ([]byte, error) { f, err := os.Open(filename) if err != nil { return nil, pathError(err) } defer f.Close() data, err := ioutil.ReadAll(f) if err != nil { return nil, err } return data, nil }
var SQLDoc = heredoc.Doc(`
$ adb mysql sg
$ adb mysql sh
`)
var WriteConfigFile = func(filename string, data []byte) error { err := os.MkdirAll(path.Dir(filename), 0o771) if err != nil { return pathError(err) } cfgFile, err := os.OpenFile(filename, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o600) if err != nil { return err } defer cfgFile.Close() n, err := cfgFile.Write(data) if err == nil && n < len(data) { err = io.ErrShortWrite } return err }
Functions ¶
Types ¶
type AliDNSStruct ¶ added in v1.0.12
type FlagStruct ¶
type FlagStruct struct {
Type string
}