pkg

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: GPL-3.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbsPath

func AbsPath() string

func NtpServer

func NtpServer(addr string)

独立的ntp server服务

func ShellExecuteRemote

func ShellExecuteRemote(ip, port, user string, password interface{}, cmdStr string) (string, error)

执行远程shell指令

func ShellExecuteRemoteStream

func ShellExecuteRemoteStream(ip, port, user string, password interface{}, cmdStr string) error

执行远程shell指令(流式输出结果)

func ShellScpRemote

func ShellScpRemote(ip, port, user string, password interface{}, src, dest string) (string, error)

func TelnetConnTest

func TelnetConnTest(ipPortSlice []string, result chan []byte)

Example: $ ./op-tools mod telnet test from=str 172.16.4.128:22 172.16.4.129:22

Types

type NtpMsg

type NtpMsg struct {
	Code    int           `json:"code"`
	Message []interface{} `json:"message"`
}

func NtpClientRemote

func NtpClientRemote(ntpServerStr string) *NtpMsg

独立的ntp client服务

func NtpNetclient

func NtpNetclient(ntpServerAddr string) *NtpMsg

获取外部ntp server的client

type NtpMsgRemote

type NtpMsgRemote struct {
	Code    int         `json:"code"`
	Message interface{} `json:"message"`
}

type NtpNetResult

type NtpNetResult struct {
	Offset   int64  `json:"offset"`
	NetDelay int64  `json:"net_delay"`
	Unit     string `json:"unit"`
}

type TelnetTestMsg

type TelnetTestMsg struct {
	Result  bool   `json:"result"`
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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