client

package
v1.2.12 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2025 License: BSD-3-Clause Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const DEFAULT_AUTO_DELETE_SECONDS = 300
View Source
const Version = "1.2.12"

Variables

This section is empty.

Functions

func AppendConfig added in v1.2.1

func AppendConfig(filename string) error

func CheckErr

func CheckErr(err error)

func CobraAddCommand

func CobraAddCommand(cobraRootCmd, parentCmd, cobraCmd CobraCommand)

func CobraInit

func CobraInit(cobraRootCmd CobraCommand)

func ConfigDir added in v1.2.1

func ConfigDir() string

func ConfigEdit

func ConfigEdit()

func ConfigInit

func ConfigInit(allowClobber bool) string

func ConfigString

func ConfigString(header bool) string

func Confirm

func Confirm(prompt string) bool

func Expand

func Expand(value string) string

func Fatal

func Fatal(err error) error

func Fatalf

func Fatalf(format string, args ...interface{}) error

func FormatJSON

func FormatJSON(v any) string

func FormatYAML added in v1.2.1

func FormatYAML(value any) string

func GetHostnameDetail added in v1.2.1

func GetHostnameDetail() (string, string, string, error)

func HexDump

func HexDump(data []byte) string

func HostDomain added in v1.2.1

func HostDomain() (string, error)

func HostFQDN added in v1.2.1

func HostFQDN() (string, error)

func HostShortname added in v1.2.1

func HostShortname() (string, error)

func Init

func Init(name, version, configFile string)

func IsDir

func IsDir(path string) bool

func IsFile

func IsFile(pathname string) bool

func OptionInt added in v1.2.1

func OptionInt(cobraCmd CobraCommand, name, flag string, defaultValue int, description string)

func OptionKey

func OptionKey(cobraCmd CobraCommand, key string) string

func OptionString

func OptionString(cobraCmd CobraCommand, name, flag, defaultValue, description string)

func OptionStringSlice added in v1.2.1

func OptionStringSlice(cobraCmd CobraCommand, name, flag string, defaultValue []string, description string)

func OptionSwitch

func OptionSwitch(cobraCmd CobraCommand, name, flag, description string)

func ProgramName

func ProgramName() string

func ProgramVersion

func ProgramVersion() string

func Shutdown

func Shutdown()

func TildePath

func TildePath(path string) (string, error)

func ViperGet added in v1.1.3

func ViperGet(key string) any

func ViperGetBool

func ViperGetBool(key string) bool

func ViperGetInt

func ViperGetInt(key string) int

func ViperGetInt64

func ViperGetInt64(key string) int64

func ViperGetString

func ViperGetString(key string) string

func ViperGetStringMapString added in v1.1.3

func ViperGetStringMapString(key string) map[string]string

func ViperGetStringSlice

func ViperGetStringSlice(key string) []string

func ViperKey

func ViperKey(key string) string

func ViperSet

func ViperSet(key string, value any)

func ViperSetDefault

func ViperSetDefault(key string, value any)

func Warning

func Warning(format string, args ...interface{})

Types

type APIClient

type APIClient interface {
	Close()
	Get(path string, response interface{}) (string, error)
	Post(path string, request, response interface{}, headers *map[string]string) (string, error)
	Put(path string, request, response interface{}, headers *map[string]string) (string, error)
	Delete(path string, response interface{}) (string, error)
}

func NewAPIClient

func NewAPIClient(prefix, url, certFile, keyFile, caFile string, headers *map[string]string) (APIClient, error)

type CobraCommand

type CobraCommand interface {
}

type Sendmail

type Sendmail interface {
	Send(to, from, subject string, body []byte) error
}

func NewSendmail

func NewSendmail(hostname string, port int, username, password, CAFile string) (Sendmail, error)

type WinexecClient added in v1.1.6

type WinexecClient struct {
	AutoDeleteSeconds int
	// contains filtered or unexported fields
}

func NewWinexecClient added in v1.1.6

func NewWinexecClient(caFile, certFile, keyFile string) (*WinexecClient, error)

func (*WinexecClient) Close added in v1.2.1

func (c *WinexecClient) Close() error

func (*WinexecClient) DeleteFile added in v1.2.1

func (c *WinexecClient) DeleteFile(pathname string) error

func (*WinexecClient) DirEntries added in v1.1.10

func (c *WinexecClient) DirEntries(pathname string) (map[string]message.DirectoryEntry, error)

func (*WinexecClient) DirFiles added in v1.1.10

func (c *WinexecClient) DirFiles(pathname string) ([]string, error)

func (*WinexecClient) DirSubs added in v1.1.12

func (c *WinexecClient) DirSubs(pathname string) ([]string, error)

func (*WinexecClient) Download added in v1.1.6

func (c *WinexecClient) Download(dst, src string) error

func (*WinexecClient) Exec added in v1.1.6

func (c *WinexecClient) Exec(command string, args, env []string, exitCode *int) (string, string, error)

func (*WinexecClient) GetConfig added in v1.1.6

func (c *WinexecClient) GetConfig() map[string]any

func (*WinexecClient) GetISO added in v1.1.6

func (c *WinexecClient) GetISO(dst, url, ca, cert, key string, autoDeleteSeconds *int) error

func (*WinexecClient) GetOS added in v1.2.1

func (c *WinexecClient) GetOS() (string, error)

func (*WinexecClient) IsDir added in v1.2.1

func (c *WinexecClient) IsDir(pathname string) (bool, error)

func (*WinexecClient) IsFile added in v1.2.1

func (c *WinexecClient) IsFile(pathname string) (bool, error)

func (*WinexecClient) MkdirAll added in v1.1.10

func (c *WinexecClient) MkdirAll(pathname string, mode fs.FileMode) error

func (*WinexecClient) RemoveAll added in v1.1.10

func (c *WinexecClient) RemoveAll(pathname string) error

func (*WinexecClient) Spawn added in v1.1.6

func (c *WinexecClient) Spawn(command string, args, env []string, exitCode *int) error

func (*WinexecClient) Upload added in v1.1.6

func (c *WinexecClient) Upload(dst, src string, force bool) error

Jump to

Keyboard shortcuts

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