Documentation
¶
Index ¶
- Constants
- Variables
- func ControlSocketPath(targetHost string) string
- func ExecCmd(target Host, command string, stdin []byte, sshArgs ...string) *exec.Cmd
- func NewSSHTunnel(targetHost Host, port string, useControlSockets bool) (operation.Operation, operation.Operation, operation.Operation)
- func ShellCommand(command string) string
- func SplitUserHostPort(raw string) (user, host, port string)
- func ValidateBinaryName(bin string) error
- type CheckSSHTunnelSecurity
- type Host
- type SSHTunnelProcessStop
- type SSHTunnelStart
- type SSHTunnelStop
Constants ¶
View Source
const PlainLocalhost = Host("localhost")
View Source
const TunnelPIDPlaceholder = "<ssh tunnel pid>"
Variables ¶
View Source
var BinaryRegex = regexp.MustCompile(`^[A-Za-z0-9_+-]+$`)
Functions ¶
func ControlSocketPath ¶
func ExecCmd ¶
ExecCmd builds a command to be executed on the target host. If the target is localhost, it will run locally when executed. Pass stdin data as optional parameter, or nil for no stdin.
func NewSSHTunnel ¶
func ShellCommand ¶
func SplitUserHostPort ¶
func ValidateBinaryName ¶
Types ¶
type CheckSSHTunnelSecurity ¶
func NewCheckSSHTunnelSecurity ¶
func NewCheckSSHTunnelSecurity(targetHost Host, port string) *CheckSSHTunnelSecurity
func (*CheckSSHTunnelSecurity) Command ¶
func (ct *CheckSSHTunnelSecurity) Command() *exec.Cmd
func (*CheckSSHTunnelSecurity) Description ¶
func (ct *CheckSSHTunnelSecurity) Description() string
type SSHTunnelProcessStop ¶
type SSHTunnelProcessStop struct {
Start *SSHTunnelStart
}
func NewSSHTunnelProcessStop ¶
func NewSSHTunnelProcessStop(start *SSHTunnelStart) *SSHTunnelProcessStop
func (*SSHTunnelProcessStop) Command ¶
func (s *SSHTunnelProcessStop) Command() *exec.Cmd
func (*SSHTunnelProcessStop) Description ¶
func (s *SSHTunnelProcessStop) Description() string
type SSHTunnelStart ¶
type SSHTunnelStart struct {
TargetHost Host
UseControlSockets bool
Port string
Process *os.Process
}
func NewSSHTunnelStart ¶
func NewSSHTunnelStart(targetHost Host, port string, useControlSockets bool) *SSHTunnelStart
func (*SSHTunnelStart) Command ¶
func (s *SSHTunnelStart) Command() *exec.Cmd
func (*SSHTunnelStart) Description ¶
func (s *SSHTunnelStart) Description() string
type SSHTunnelStop ¶
type SSHTunnelStop struct {
TargetHost Host
}
func NewSSHTunnelStop ¶
func NewSSHTunnelStop(targetHost Host) *SSHTunnelStop
func (*SSHTunnelStop) Command ¶
func (s *SSHTunnelStop) Command() *exec.Cmd
func (*SSHTunnelStop) Description ¶
func (s *SSHTunnelStop) Description() string
Click to show internal directories.
Click to hide internal directories.