myssh

package
v0.0.0-...-4215923 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cli

type Cli struct {
	IP       string //IP地址
	Username string //用户名
	Password string //密码
	Port     int    //端口号
	// contains filtered or unexported fields
}

Cli ...

func New

func New(ip string, username string, password string, port ...int) (*Cli, error)

New 创建命令行对象 ip IP地址 username 用户名 password 密码 port 端口号,默认22

func (Cli) Enter

func (c Cli) Enter(w io.Writer, r io.Reader) error

Enter 完全进入终端

func (Cli) EnterTerminal

func (c Cli) EnterTerminal() error

EnterTerminal 完全进入终端

func (Cli) Run

func (c Cli) Run(shell string) (string, error)

Run 执行 shell脚本命令

func (*Cli) RunTerminal

func (c *Cli) RunTerminal(shell string) error

RunTerminal 执行带交互的命令

type MyReader

type MyReader struct {
	// contains filtered or unexported fields
}

MyReader io reader

func NewReader

func NewReader() *MyReader

NewReader new io reader

func (*MyReader) Close

func (r *MyReader) Close()

Close 关闭

func (*MyReader) ListenStdin

func (r *MyReader) ListenStdin()

ListenStdin 监听cmd 输入

func (*MyReader) Push

func (r *MyReader) Push(src string)

Push push one string

func (*MyReader) Read

func (r *MyReader) Read(p []byte) (n int, err error)

type MyWriter

type MyWriter struct {
	// contains filtered or unexported fields
}

MyWriter io.Writer

func NewWriter

func NewWriter() *MyWriter

NewWriter new writer

func (*MyWriter) Close

func (w *MyWriter) Close()

Close 关闭

func (*MyWriter) Consume

func (w *MyWriter) Consume() string

Consume 消费

func (*MyWriter) Run

func (w *MyWriter) Run()

Run 消费

func (*MyWriter) Write

func (w *MyWriter) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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