internal

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Red     Color = "red"
	Blue          = "blue"
	Green         = "green"
	Cyan          = "cyan"
	Yellow        = "yellow"
	NoColor       = ""
)

Variables

This section is empty.

Functions

func BeautifyText

func BeautifyText(text string, color Color) string

BeautifyText function for send (colored or common) message to output.

func ExecCommand

func ExecCommand(command string, options []string) error

ExecCommand function to execute a given command.

func HttpFileServ

func HttpFileServ(folderPath string) error

func MakeFolder

func MakeFolder(folderName string, chmod os.FileMode) error

func NewSSHClient

func NewSSHClient(c SSHConfig) (*sshClient, error)

func OpenFolder

func OpenFolder(folderName string) error

func PrivateIPv4

func PrivateIPv4() (net.IP, error)

func RenderQRImage

func RenderQRImage(s string) image.Image

RenderQRImage returns a QR code as an image.Image

func RenderQRString

func RenderQRString(s string)

RenderQRString as a QR code

func RunCmd

func RunCmd(cmdStr string, cmdDir ...string) error

func SendMsg

func SendMsg(startWithNewLine bool, caption, text string, color Color, endWithNewLine bool)

SendMsg function for send message to output.

func SetSttySane

func SetSttySane()

Types

type AuthMethod

type AuthMethod string
const (
	PublicKey AuthMethod = "publickey"
	Password  AuthMethod = "password"
)

type Color

type Color string

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 SSHDial

type SSHDial interface {
	NewSSHClient(conf SSHConfig) (*sshClient, error)
}

type SSHPasswordConfig

type SSHPasswordConfig struct {
	*SSHBaseConfig
}

type SSHPrivateKeyConfig

type SSHPrivateKeyConfig struct {
	*SSHBaseConfig
}

Jump to

Keyboard shortcuts

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