ssh

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Sudo = 0b10
	Log  = 0b01
	None = 0b00
)

Variables

This section is empty.

Functions

func Sync

func Sync(nodes []*Node, run func(i int, node *Node))

Types

type Facts added in v0.5.0

type Facts struct {
	Hostname      string `ngx:"hostname"`
	ReleaseName   string `ngx:"releaseName"`
	MajorVersion  string `ngx:"majorVersion"`
	KernelVersion string `ngx:"kernelVersion"`
}

type Node

type Node struct {
	Host          string `ngx:"host" flag:"-"`
	Port          int    `ngx:"port" short:"p" help:"ssh port" def:"22"`
	User          string `ngx:"user" short:"u" help:"ssh user" def:"root"`
	Password      string `ngx:"password" short:"P" help:"ssh password"`
	PrivateKey    string `ngx:"private-key" short:"i" help:"ssh private key" def:"$HOME/.ssh/id_rsa"`
	PrivateKeyRaw string `ngx:"private-key-raw" help:"ssh private key"`
	Passphrase    string `ngx:"passphrase" flag:"passphrase" help:"private key passphrase"`

	Hostname string `ngx:"hostname" flag:"-"`

	Proxy     string `ngx:"proxy"`
	ProxyNode *Node  `ngx:"-" flag:"-"`

	Facts Facts `ngx:"-" flag:"-"`

	Timeout           time.Duration `ngx:"-" flag:"-"`
	Ciphers           []string      `ngx:"-" flag:"-"`
	KeyExchanges      []string      `ngx:"-" flag:"-"`
	Fingerprint       string        `ngx:"-" flag:"-"`
	UseInsecureCipher bool          `ngx:"-" flag:"-"`
	// contains filtered or unexported fields
}

func (*Node) Cmd

func (node *Node) Cmd(command string) error

func (*Node) CmdBytes added in v0.5.0

func (node *Node) CmdBytes(command string) (*bytes.Buffer, error)

func (*Node) CmdOutput added in v0.5.0

func (node *Node) CmdOutput(command string, output io.Writer) error

func (*Node) CmdPrefixStdout added in v0.5.0

func (node *Node) CmdPrefixStdout(command string) error

func (*Node) CmdStdout added in v0.5.0

func (node *Node) CmdStdout(command string) error

func (*Node) CmdString added in v0.5.0

func (node *Node) CmdString(command string) (string, error)

func (*Node) CmdWatcher added in v0.5.0

func (node *Node) CmdWatcher(command string, watcher StreamWatcher) (err error)

func (*Node) Equal added in v0.5.0

func (node *Node) Equal(local interface{}, remote string) bool

func (*Node) GatheringFacts added in v0.5.0

func (node *Node) GatheringFacts() error

func (*Node) HideLog added in v0.5.0

func (node *Node) HideLog() *Node

func (*Node) HomeDir

func (node *Node) HomeDir(join ...string) string

func (*Node) IsCentOS added in v0.5.0

func (node *Node) IsCentOS() bool

func (*Node) IsRoot added in v0.5.0

func (node *Node) IsRoot() bool

func (*Node) IsUbuntu added in v0.5.0

func (node *Node) IsUbuntu() bool

func (*Node) Logger

func (node *Node) Logger(format string, params ...interface{})

func (*Node) Prefix added in v0.5.0

func (node *Node) Prefix() string

func (*Node) Pull

func (node *Node) Pull(remotePath, localPath string) error

func (*Node) Retries added in v0.5.0

func (node *Node) Retries(retries int) *Node

func (*Node) Scp

func (node *Node) Scp(localPath, remotePath string) error

func (*Node) ScpContent

func (node *Node) ScpContent(content []byte, remotePath string) error

func (*Node) Shell

func (node *Node) Shell(shell string, watch StreamWatcher) error

func (*Node) Sudo added in v0.5.0

func (node *Node) Sudo() *Node

func (*Node) Vik8s

func (node *Node) Vik8s(join ...string) string

type Nodes

type Nodes []*Node

func (*Nodes) Get

func (nodes *Nodes) Get(hostnameOrIP string) *Node

func (Nodes) Hosts added in v0.6.1

func (nodes Nodes) Hosts() []string

type StreamWatcher added in v0.5.0

type StreamWatcher func(stdout io.Reader) error

Jump to

Keyboard shortcuts

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