options

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const LoopBackIp = "127.0.0.1"

Variables

This section is empty.

Functions

This section is empty.

Types

type CmdLog added in v1.0.2

type CmdLog struct {
	Time      string `json:"time,omitempty"`
	Cmd       string `json:"cmd,omitempty"`
	ErrString string `json:"error,omitempty"`
	Output    string `json:"output,omitempty"`
	Host      string `json:"host,omitempty"`
}

func (*CmdLog) ToJson added in v1.0.2

func (cmdLog *CmdLog) ToJson() string

type Option

type Option interface {
	Set(opt *Options) error
}

func Arch added in v1.0.3

func Arch(ar string) Option

func EnableSingle

func EnableSingle() Option

func Host added in v1.0.2

func Host(ip string) Option

func HostPWD added in v1.0.2

func HostPWD(ip string, port uint16, user string, password string) Option

func HostPort added in v1.0.3

func HostPort(ip string, port uint16) Option

func Linux added in v1.0.3

func Linux() Option

func LocalFunc added in v1.0.2

func LocalFunc(localIps map[string]struct{}) Option

func LocalHost

func LocalHost() Option

func LogInterceptor added in v1.0.2

func LogInterceptor(f func(w io.Writer, cmd string, output string, err error)) Option

func LogPath

func LogPath(path string) Option

func LogWriter

func LogWriter(w io.Writer) Option

func Single

func Single(isSingle bool) Option

func SshKeyPath

func SshKeyPath(path string) Option

func Windows added in v1.0.3

func Windows() Option

type Options

type Options struct {
	Writer         io.Writer
	LogInterceptor func(w io.Writer, cmd string, output string, err error)
	LocalIps       map[string]struct{}
	Single         bool
	Ip             string
	Port           uint16
	User           string
	Password       string
	SshKeyPath     string
	Arch           string
}

func Default

func Default() Options

Jump to

Keyboard shortcuts

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