root

package
v0.0.0-...-4393ae7 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TextBlack = iota + 30
	TextRed
	TextGreen
	TextYellow
	TextBlue
	TextMagenta
	TextCyan
	TextWhite
)
View Source
const (
	SUCCESS = iota
	FAILED
	UNREACHABLE
)

Variables

View Source
var MsgFlags = map[int]string{
	SUCCESS:     "SUCCESS",
	FAILED:      "FAILED",
	UNREACHABLE: "UNREACHABLE",
}

Functions

func Black

func Black(msg string) string

func Blue

func Blue(msg string) string

func Cyan

func Cyan(msg string) string

func GenHostList

func GenHostList(hosts, hostRange, hostNet string) (hostList []string, err error)

func Green

func Green(msg string) string

func Magenta

func Magenta(msg string) string

func Red

func Red(msg string) string

func SetColor

func SetColor(msg string, conf, bg, text int) string

func White

func White(msg string) string

func Yellow

func Yellow(msg string) string

Types

type Connection

type Connection struct {
	Host     string
	Port     string
	Username string
	Password string
	Key      string
}

func ParseAllGroups

func ParseAllGroups() (conns []Connection, err error)

func ParseGroups

func ParseGroups(groups string) (conns []Connection, err error)

func (Connection) OutPut

func (c Connection) OutPut(command string, wg *sync.WaitGroup, ch chan bool) (output string, err error)

func (Connection) SFTPConnect

func (c Connection) SFTPConnect() (*sftp.Client, error)

func (Connection) SSHConnect

func (c Connection) SSHConnect() (*ssh.Session, error)

type Result

type Result struct {
	*Connection
	Status string
	Msg    string
}

func (*Result) ColorResult

func (r *Result) ColorResult() (res string)

func (*Result) GenResult

func (r *Result) GenResult(e error) Result

func (*Result) ResultStatus

func (r *Result) ResultStatus(code int) string

Jump to

Keyboard shortcuts

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