tools

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TEMPLATE_SCP                             = `scp -P {{.port}} {{or .options ""}} {{.source}} {{.user}}@{{.host}}:{{.target}}`
	TEMPLATE_SSH_COMMAND                     = `ssh {{.user}}@{{.host}} -p {{.port}} {{or .options ""}} {{or .become ""}} {{.command}}`
	TEMPLATE_SSH_ATTACH                      = `ssh -tt {{.user}}@{{.host}} -p {{.port}} {{or .options ""}} {{or .become ""}} {{.command}}`
	TEMPLATE_COMMAND_EXEC_CONTAINER          = `{{.sudo}} {{.engine}} exec -it {{.container_id}} /bin/bash -c "cd {{.home_dir}}; /bin/bash"`
	TEMPLATE_LOCAL_EXEC_CONTAINER            = `{{.engine}} exec -it {{.container_id}} /bin/bash` // FIXME: merge it
	TEMPLATE_COMMAND_EXEC_CONTAINER_NOATTACH = `{{.sudo}} {{.engine}} exec -t {{.container_id}} /bin/bash -c "{{.command}}"`
)
View Source
const (
	URL_LATEST_VERSION   = "http://curveadm.nos-eastchina1.126.net/release/__version"
	URL_INSTALL_SCRIPT   = "http://curveadm.nos-eastchina1.126.net/script/install.sh"
	HEADER_VERSION       = "X-Nos-Meta-Curveadm-Latest-Version"
	ENV_CURVEADM_UPGRADE = "CURVEADM_UPGRADE"
	ENV_CURVEADM_VERSION = "CURVEADM_VERSION"
)
View Source
const (
	URL_UPLOAD_SUPPORT_TARBALL = "http://curveadm.aspirer.wang:19301/upload?path=/"
)

Variables

This section is empty.

Functions

func AttachLocalContainer added in v0.2.0

func AttachLocalContainer(curveadm *cli.CurveAdm, containerId string) error

func AttachRemoteContainer added in v0.1.0

func AttachRemoteContainer(curveadm *cli.CurveAdm, host, containerId, home string) error

func AttachRemoteHost added in v0.1.0

func AttachRemoteHost(curveadm *cli.CurveAdm, host string, become bool) error

func ExecCmdInRemoteContainer added in v0.2.0

func ExecCmdInRemoteContainer(curveadm *cli.CurveAdm, host, containerId, cmd string) error

func ExecuteRemoteCommand added in v0.2.0

func ExecuteRemoteCommand(curveadm *cli.CurveAdm, host, command string) (string, error)

func GetLatestVersion added in v0.1.0

func GetLatestVersion(currentVersion string) (string, error)

func Scp added in v0.2.0

func Scp(curveadm *cli.CurveAdm, host, source, target string) error

func Upgrade

func Upgrade(version string) error

func Upgrade2Latest added in v0.2.0

func Upgrade2Latest(currentVersion string) error

func Upload

func Upload(filepath string) error

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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