files

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendConfig

func AppendConfig(filename string) error

func CalculateSHA512 added in v1.1.44

func CalculateSHA512(filename string) (string, error)

func CheckErr

func CheckErr(err error)

func CobraAddCommand

func CobraAddCommand(cobraRootCmd, parentCmd, cobraCmd CobraCommand)

func CobraInit

func CobraInit(cobraRootCmd CobraCommand)

func ConfigDir

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 CopyFile

func CopyFile(dstPathname, srcPathname string) error

func CopyFileFromFS

func CopyFileFromFS(dstPathname, srcPathname string, srcFS fs.FS) error

func CopyTree added in v1.0.50

func CopyTree(dstPath, srcPath string) error

func Expand

func Expand(value string) string

func ExtractTarball added in v1.0.47

func ExtractTarball(dstDir, tarPath string) error

extract directories and files from tgz tarball caveat: extracts ONLY directories and files; sets owner:group to current user

func ExtractTarballFile

func ExtractTarballFile(dstPath, srcPath, tarPath string) error

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

func FormatYAML(value any) string

func GetHostnameDetail

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

func HexDump

func HexDump(data []byte) string

func HostDomain

func HostDomain() (string, error)

func HostFQDN

func HostFQDN() (string, error)

func HostShortname

func HostShortname() (string, error)

func Init

func Init(name, version, configFile string)

func IsDir

func IsDir(path string) bool

func IsDirFS

func IsDirFS(filesystem fs.FS, pathname string) bool

func IsFile

func IsFile(pathname string) bool

func IsFileFS

func IsFileFS(filesystem fs.FS, pathname string) bool

func OptionInt

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

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 TreeFiles added in v1.2.33

func TreeFiles(basePath, srcPath string) ([]string, error)

func Unzip

func Unzip(dstName, srcName string) error

func UnzipFile

func UnzipFile(filename string) (string, error)

func UnzipFileFromFS

func UnzipFileFromFS(dstPathname, srcPathname string, srcFS fs.FS) error

func ViperGet

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

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{})

func WriteTarball

func WriteTarball(dstPath, srcDir string, chownRoot bool, symlinks []string, modes map[string]fs.FileMode) error

func Zip

func Zip(dstName, srcName string) error

func ZipFile

func ZipFile(filename string) (string, error)

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 LinkInfo

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

func (*LinkInfo) IsDir

func (i *LinkInfo) IsDir() bool

func (*LinkInfo) ModTime

func (i *LinkInfo) ModTime() time.Time

func (*LinkInfo) Mode

func (i *LinkInfo) Mode() fs.FileMode

func (*LinkInfo) Name

func (i *LinkInfo) Name() string

func (*LinkInfo) Size

func (i *LinkInfo) Size() int64

func (*LinkInfo) Sys

func (i *LinkInfo) Sys() any

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