alicloud

package
v0.0.0-...-1142a2b Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const PublicKeyFilePath = "/root/.ssh/id_rsa"

Variables

View Source
var (
	SSHUserName = "root"
)

Functions

func CheckPolicyIsReload

func CheckPolicyIsReload(policy *GetControllerConfigPolicy) bool

func CutOffWarningLine

func CutOffWarningLine(orgErrStr string) string

func ExecCommand

func ExecCommand(runCmdNode string, checkSucceedFunc func(string, error) bool, cmdList ...string) error

func PublicKeyFile

func PublicKeyFile(file string) ssh.AuthMethod

func RunSSHNoPwdCMD

func RunSSHNoPwdCMD(cmd string, remoteAddress string, tags ...string) (string, string, error)

RunSSHNoPwdCMD run shell command

func SSHConnect

func SSHConnect(user, host string, port int) (*ssh.Client, error)

func ShowSubString

func ShowSubString(orgText string, l int) string

Types

type ControllerConfig

type ControllerConfig struct {
	SshUser         string
	EnablePrintPort bool
}

func GetControllerConfig

func GetControllerConfig() (*ControllerConfig, error)

func GetControllerConfigWithPolicy

func GetControllerConfigWithPolicy(policy *GetControllerConfigPolicy) (*ControllerConfig, error)

type GetControllerConfigPolicy

type GetControllerConfigPolicy struct {
	IsInited         bool
	LastQueryTime    *time.Time
	MaxQueryStepTime *time.Duration    //如果值为0表示只读一次,此值设置原则上不允许修改,否则会逻辑错乱
	LastValue        *ControllerConfig //最后一次结果暂存器
}
var ControllerConfigPolicy *GetControllerConfigPolicy

type SSHConnection

type SSHConnection struct {
	TagStr string

	Counter int
	// contains filtered or unexported fields
}

func NewSSHConnection

func NewSSHConnection(user, host string, port int, tags ...string) *SSHConnection

func NewSSHConnectionByHost

func NewSSHConnectionByHost(host string, tags ...string) *SSHConnection

func (*SSHConnection) Close

func (conn *SSHConnection) Close()

func (*SSHConnection) Init

func (conn *SSHConnection) Init() error

func (*SSHConnection) IsInit

func (conn *SSHConnection) IsInit() bool

func (*SSHConnection) ResetTime

func (conn *SSHConnection) ResetTime()

func (*SSHConnection) RunCmdWithLogLevel

func (conn *SSHConnection) RunCmdWithLogLevel(cmd string, autoClose bool, logLevel int) (string, string, error)

func (*SSHConnection) TestAlive

func (conn *SSHConnection) TestAlive() bool

Directories

Path Synopsis
Package core_version *
Package core_version *
Package events *
Package events *

Jump to

Keyboard shortcuts

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