utils

package
v0.0.0-...-3a391b9 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Exitcodes
	Success exitCode = iota
	InvalidEnv
	MissingInput
	NotHandled
)

Variables

View Source
var (
	Epoch = time.Unix(0, 0)
)

Functions

func IfErrorExitOrPanic

func IfErrorExitOrPanic(err error)

func MakeCompositeError

func MakeCompositeError(prefix string, errSlice []error) error

func MakeCompositeInvalidEnvError

func MakeCompositeInvalidEnvError(errSlice []error) error

func ParseTimestamp

func ParseTimestamp(timestamp string) (time.Time, error)

ParseTimestamp converts an input number of seconds (including a decimal fraction) into a time.Time

func RemoveTempFiles

func RemoveTempFiles(dir string, filenames []string)

Types

type InvalidEnvError

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

func NewInvalidEnvError

func NewInvalidEnvError(err error) *InvalidEnvError

func (InvalidEnvError) Error

func (err InvalidEnvError) Error() string

func (InvalidEnvError) Unwrap

func (err InvalidEnvError) Unwrap() error

type MissingInputError

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

func NewMissingInputError

func NewMissingInputError(err error) *MissingInputError

func (MissingInputError) Error

func (err MissingInputError) Error() string

func (MissingInputError) Unwrap

func (err MissingInputError) Unwrap() error

type RequirementsNotMetError

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

func NewRequirementsNotMetError

func NewRequirementsNotMetError(err error) *RequirementsNotMetError

func (RequirementsNotMetError) Error

func (err RequirementsNotMetError) Error() string

func (RequirementsNotMetError) Unwrap

func (err RequirementsNotMetError) Unwrap() error

type WaitGroupCount

type WaitGroupCount struct {
	sync.WaitGroup
	// contains filtered or unexported fields
}

The standard sync.WaitGroup doesn't expose the count of members as this is considered internal state however this value is very useful.

func (*WaitGroupCount) Add

func (wg *WaitGroupCount) Add(delta int)

func (*WaitGroupCount) Done

func (wg *WaitGroupCount) Done()

func (*WaitGroupCount) GetCount

func (wg *WaitGroupCount) GetCount() int

Jump to

Keyboard shortcuts

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