client

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2025 License: BSD-3-Clause Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckErr

func CheckErr(err error)

func CobraAddCommand

func CobraAddCommand(cobraRootCmd, parentCmd, cobraCmd CobraCommand)

func CobraInit

func CobraInit(cobraRootCmd CobraCommand)

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(pathname 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 HexDump

func HexDump(data []byte) string

func Init

func Init(name, version, configFile string)

func IsDir

func IsDir(path string) bool

func IsFile

func IsFile(pathname string) bool

func OptionKey

func OptionKey(cobraCmd CobraCommand, key string) string

func OptionString

func OptionString(cobraCmd CobraCommand, name, flag, defaultValue, 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 Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient() (*Client, error)

func (*Client) Download

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

func (*Client) Exec

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

func (*Client) GetConfig added in v1.1.3

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

func (*Client) GetISO

func (c *Client) GetISO(dst, url, ca, cert, key string) error

func (*Client) Spawn

func (c *Client) Spawn(command string, exitCode *int) error

func (*Client) Upload

func (c *Client) Upload(dst, src string) 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)

Jump to

Keyboard shortcuts

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