Documentation ¶
Index ¶
- Constants
- func BeautifyText(text string, color Color) string
- func ExecCommand(command string, options []string) error
- func HttpFileServ(folderPath string) error
- func MakeFolder(folderName string, chmod os.FileMode) error
- func NewSSHClient(c SSHConfig) (*sshClient, error)
- func OpenFolder(folderName string) error
- func PrivateIPv4() (net.IP, error)
- func RenderQRImage(s string) image.Image
- func RenderQRString(s string)
- func RunCmd(cmdStr string, cmdDir ...string) error
- func SendMsg(startWithNewLine bool, caption, text string, color Color, endWithNewLine bool)
- func SetSttySane()
- type AuthMethod
- type Color
- type SSHBaseConfig
- type SSHConfig
- type SSHDial
- type SSHPasswordConfig
- type SSHPrivateKeyConfig
Constants ¶
View Source
const ( Red Color = "red" Blue = "blue" Green = "green" Cyan = "cyan" Yellow = "yellow" NoColor = "" )
Variables ¶
This section is empty.
Functions ¶
func BeautifyText ¶
BeautifyText function for send (colored or common) message to output.
func ExecCommand ¶
ExecCommand function to execute a given command.
func HttpFileServ ¶
func NewSSHClient ¶
func OpenFolder ¶
func PrivateIPv4 ¶
func RenderQRImage ¶
RenderQRImage returns a QR code as an image.Image
func SetSttySane ¶
func SetSttySane()
Types ¶
type AuthMethod ¶
type AuthMethod string
const ( PublicKey AuthMethod = "publickey" Password AuthMethod = "password" )
type SSHBaseConfig ¶
type SSHBaseConfig struct { MethodName AuthMethod URI string User string Passphrase string AuthMethods []ssh.AuthMethod Timout time.Duration Proxy SSHConfig StartCommand string }
func (*SSHBaseConfig) AuthMethodName ¶
func (c *SSHBaseConfig) AuthMethodName() AuthMethod
func (*SSHBaseConfig) GetProxy ¶
func (c *SSHBaseConfig) GetProxy() SSHConfig
func (*SSHBaseConfig) GetStartCommand ¶
func (c *SSHBaseConfig) GetStartCommand() string
func (*SSHBaseConfig) GetURI ¶
func (c *SSHBaseConfig) GetURI() string
func (*SSHBaseConfig) SSHConfig ¶
func (c *SSHBaseConfig) SSHConfig() *ssh.ClientConfig
func (*SSHBaseConfig) SetProxy ¶
func (c *SSHBaseConfig) SetProxy(proxyConfig SSHConfig)
type SSHConfig ¶
type SSHConfig interface { SSHConfig() *ssh.ClientConfig AuthMethodName() AuthMethod GetProxy() SSHConfig SetProxy(proxyConfig SSHConfig) GetURI() string GetStartCommand() string }
type SSHPasswordConfig ¶
type SSHPasswordConfig struct {
*SSHBaseConfig
}
type SSHPrivateKeyConfig ¶
type SSHPrivateKeyConfig struct {
*SSHBaseConfig
}
Click to show internal directories.
Click to hide internal directories.