Documentation ¶
Overview ¶
http://dockone.io/article/109 https://docs.docker.com/engine/api/v1.24/#2-errors https://godoc.org/github.com/docker/docker/client#FromEnv
读取指定yaml文件
有关Http协议GET和POST请求的封装 https://studygolang.com/articles/17373?fr=sidebar
Index ¶
- func ApplyTemplate(temp string, data map[string]interface{}) (string, error)
- func DecodeBase64(in string) (string, error)
- func EncodeBase64(in string) string
- func ExecCommand(cmd string) ([]byte, error)
- func ExecCommandStd(cmd string) error
- func ExecCommandString(cmd string) (string, error)
- func Get(url string) (response []byte, err error)
- func GetCurrentDirectory() string
- func GetIPs() (ips []string)
- func GetMacAddrs() (macAddrs []string)
- func GetRandomSalt() string
- func GetRandomString(len int) string
- func IsBetweenAB(start, end string) (bool, error)
- func Jiami(code string) string
- func MD5(text string) string
- func NewDockerCLI(host, port, version string) *docker
- func NewDockerCli(args []string, image, cmd, workspace, reponame string) *dockerCli
- func ParseIps(in string) ([]string, error)
- func PathExists(path string) (bool, error)
- func Post(url string, data interface{}, contentType string) (result []byte, err error)
- func ReadYamlConfig(path string) (interface{}, error)
- func ScanPort(host string, port int) bool
- func TransformCHN(data []string) ([]int, error)
- type Cli
- func (c *Cli) Run(shell string) (string, error)
- func (c *Cli) RunTerminal(shell string, stdout, stderr io.Writer) error
- func (c *Cli) SftpDownloadToLocal(localpath, remotepath string) error
- func (c *Cli) SftpUploadTemplateString(data, remotepath string) error
- func (c *Cli) SftpUploadToRemote(localpath, remotepath string) error
- type LogFileWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyTemplate ¶
渲染模板
func ExecCommand ¶
func ExecCommandStd ¶
func ExecCommandString ¶
func GetCurrentDirectory ¶
func GetCurrentDirectory() string
func NewDockerCLI ¶
func NewDockerCLI(host, port, version string) *docker
func NewDockerCli ¶
Types ¶
type Cli ¶
type Cli struct { IP string //IP地址 Username string //用户名 Password string //密码 Port int //端口号 LastResult string //最近一次Run的结果 // contains filtered or unexported fields }
func (*Cli) RunTerminal ¶
执行带交互的命令
func (*Cli) SftpDownloadToLocal ¶
下载文件
func (*Cli) SftpUploadTemplateString ¶
上传文件String
func (*Cli) SftpUploadToRemote ¶
上传文件 注意: remotepath是文件路径不是文件夹路径
Click to show internal directories.
Click to hide internal directories.