Documentation ¶
Index ¶
- Constants
- Variables
- func CheckPolicyIsReload(policy *GetControllerConfigPolicy) bool
- func CutOffWarningLine(orgErrStr string) string
- func ExecCommand(runCmdNode string, checkSucceedFunc func(string, error) bool, ...) error
- func PublicKeyFile(file string) ssh.AuthMethod
- func RunSSHNoPwdCMD(cmd string, remoteAddress string, tags ...string) (string, string, error)
- func SSHConnect(user, host string, port int) (*ssh.Client, error)
- func ShowSubString(orgText string, l int) string
- type ControllerConfig
- type GetControllerConfigPolicy
- type SSHConnection
- func (conn *SSHConnection) Close()
- func (conn *SSHConnection) Init() error
- func (conn *SSHConnection) IsInit() bool
- func (conn *SSHConnection) ResetTime()
- func (conn *SSHConnection) RunCmdWithLogLevel(cmd string, autoClose bool, logLevel int) (string, string, error)
- func (conn *SSHConnection) TestAlive() bool
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 ExecCommand ¶
func PublicKeyFile ¶
func PublicKeyFile(file string) ssh.AuthMethod
func RunSSHNoPwdCMD ¶
RunSSHNoPwdCMD run shell command
func ShowSubString ¶
Types ¶
type ControllerConfig ¶
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 ¶
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 (*SSHConnection) TestAlive ¶
func (conn *SSHConnection) TestAlive() bool
Directories ¶
Path | Synopsis |
---|---|
Package core_version *
|
Package core_version * |
Package events *
|
Package events * |
Click to show internal directories.
Click to hide internal directories.