Documentation
¶
Index ¶
- func AddToTar(tw *tar.Writer, pth string, name string, ...) error
- func AskForConfirmation(prompt string) bool
- func CopyDir(src string, dst string) error
- func CopyFile(src string, dst string) error
- func CopyFileStream(src io.Reader, dst string) error
- func DeepCopy(dst interface{}, src interface{}) error
- func Exists(path string) bool
- func ExpandPath(p string) string
- func ExtractTarGzFile(tarGzPath string, targetPath string) error
- func ExtractTarGzStream(r io.Reader, targetPath string) error
- func FindStrInSlice(a []string, s string) int
- func FsCopyDir(srcFs fs.FS, src string, dst string) error
- func FsCopyFile(srcFs fs.FS, src, dst string) error
- func GetTmpBaseDir() string
- func HashTarEntry(dir string, name string) (string, error)
- func IntMax(a, b int) int
- func IntMin(a, b int) int
- func IsDirectory(path string) bool
- func IsFile(path string) bool
- func IsLaunchedByDebugger() bool
- func NewErrorList(errors []error) *errorList
- func ParseBoolOrFalse(s *string) bool
- func ParseEnvConfigSets(prefix string) map[int]map[string]string
- func RandomString(n int) string
- func Sha256Bytes(data []byte) string
- func Sha256String(data string) string
- func Touch(path string) error
- type Inclusion
- type InclusionEntry
- type OnceByKey
- type OrderedMap
- type PrettyTable
- type Row
- type ThreadSafeCache
- type ThreadSafeMultiCache
- type WorkerPoolWithErrors
- func (wp *WorkerPoolWithErrors) Errors() []error
- func (wp *WorkerPoolWithErrors) Results() []interface{}
- func (wp *WorkerPoolWithErrors) StopWait(restart bool) error
- func (wp *WorkerPoolWithErrors) Submit(cb func() error)
- func (wp *WorkerPoolWithErrors) SubmitWithResult(cb func() (interface{}, error))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AskForConfirmation ¶
AskForConfirmation uses Scanln to parse user input. A user must type in "yes" or "no" and then press enter. It has fuzzy matching, so "y", "Y", "yes", "YES", and "Yes" all count as confirmations. If the input is not recognized, it will ask again. The function does not return until it gets a valid response from the user. Typically, you should use fmt to print out a question before calling askForConfirmation. E.g. fmt.Println("WARNING: Are you sure? (yes/no)")
func ExpandPath ¶
func ExtractTarGzFile ¶
func FindStrInSlice ¶
func GetTmpBaseDir ¶
func GetTmpBaseDir() string
func IsDirectory ¶
func IsLaunchedByDebugger ¶
func IsLaunchedByDebugger() bool
func NewErrorList ¶
func NewErrorList(errors []error) *errorList
func ParseBoolOrFalse ¶
func RandomString ¶
func Sha256Bytes ¶
func Sha256String ¶
Types ¶
type Inclusion ¶
type Inclusion struct {
// contains filtered or unexported fields
}
func NewInclusion ¶
func NewInclusion() *Inclusion
func (*Inclusion) AddExclude ¶
func (*Inclusion) AddInclude ¶
func (*Inclusion) CheckIncluded ¶
func (inc *Inclusion) CheckIncluded(l []InclusionEntry, excludeIfNotIncluded bool) bool
type InclusionEntry ¶
type OrderedMap ¶
type OrderedMap struct {
// contains filtered or unexported fields
}
func (*OrderedMap) Get ¶
func (s *OrderedMap) Get(v string) (interface{}, bool)
func (*OrderedMap) Has ¶
func (s *OrderedMap) Has(v string) bool
func (*OrderedMap) ListKeys ¶
func (s *OrderedMap) ListKeys() []string
func (*OrderedMap) ListValues ¶
func (s *OrderedMap) ListValues() []interface{}
func (*OrderedMap) Set ¶
func (s *OrderedMap) Set(k string, v interface{}) bool
type PrettyTable ¶
type PrettyTable struct {
// contains filtered or unexported fields
}
func (*PrettyTable) AddRow ¶
func (t *PrettyTable) AddRow(c ...string)
func (*PrettyTable) Render ¶
func (t *PrettyTable) Render(limitWidths []int) string
func (*PrettyTable) SortRows ¶
func (t *PrettyTable) SortRows(col int)
type ThreadSafeCache ¶
type ThreadSafeCache struct {
// contains filtered or unexported fields
}
type ThreadSafeMultiCache ¶
type ThreadSafeMultiCache struct {
// contains filtered or unexported fields
}
type WorkerPoolWithErrors ¶
type WorkerPoolWithErrors struct {
// contains filtered or unexported fields
}
func NewDebuggerAwareWorkerPool ¶
func NewDebuggerAwareWorkerPool(maxWorkers int) *WorkerPoolWithErrors
func NewWorkerPoolWithErrors ¶
func NewWorkerPoolWithErrors(maxWorkers int) *WorkerPoolWithErrors
func (*WorkerPoolWithErrors) Errors ¶
func (wp *WorkerPoolWithErrors) Errors() []error
func (*WorkerPoolWithErrors) Results ¶
func (wp *WorkerPoolWithErrors) Results() []interface{}
func (*WorkerPoolWithErrors) StopWait ¶
func (wp *WorkerPoolWithErrors) StopWait(restart bool) error
func (*WorkerPoolWithErrors) Submit ¶
func (wp *WorkerPoolWithErrors) Submit(cb func() error)
func (*WorkerPoolWithErrors) SubmitWithResult ¶
func (wp *WorkerPoolWithErrors) SubmitWithResult(cb func() (interface{}, error))
Source Files
¶
Click to show internal directories.
Click to hide internal directories.