Documentation ¶
Index ¶
- func CheckDirectory(path string) error
- func CheckDirectoryOrCreate(path string) error
- func CheckEmptyDirectoryOrCreate(path string) error
- func CopyDirectory(src, dst string) error
- func CopyFile(from string, to string) error
- func CopyFileWithReplacement(from string, to string, replacements []Replacement) error
- func CreateDirIf(path string) error
- func Debug() bool
- func Exit(msg string, args ...any)
- func ExitOnError(err error, msg string, args ...any)
- func FileExists(p string) bool
- func ForwardLogs(r io.ReadCloser, w io.Writer)
- func GenerateTree(p, indent string) (string, error)
- func HandleError(err error)
- func IsOutputError(err error) (error, bool)
- func IsUserError(err error) bool
- func IsUserWarning(err error) bool
- func NewOutputError(format string, args ...any) error
- func NewUserWarning(format string, args ...any) error
- func ParseError(s string) error
- func SetDebug(d bool)
- func SetTodo(t bool)
- func SetTrace(t bool)
- func Todo() bool
- func Trace() bool
- func UnexpectedExitOnError(err error, msg string, args ...any)
- func UserErrorMessage(err error) string
- func UserWarnMessage(err error) string
- func WrapStart(cmd *exec.Cmd, logger BaseLogger) error
- func Wrapf(err error, format string, args ...any) error
- type BaseLogger
- type CopyInstruction
- type Dir
- type File
- type LogLevel
- type Logger
- func (l *Logger) Catch()
- func (l *Logger) DebugMe(format string, args ...any)
- func (l *Logger) Debugf(format string, args ...any)
- func (l *Logger) Errorf(format string, args ...any) error
- func (l *Logger) IfNot(base BaseLogger) BaseLogger
- func (l *Logger) Info(format string, args ...any)
- func (l *Logger) Message(format string, args ...any)
- func (l *Logger) Oops(format string, args ...any)
- func (l *Logger) SetLevel(lvl LogLevel)
- func (l *Logger) TODO(format string, args ...any)
- func (l *Logger) Tracef(format string, args ...any)
- func (l *Logger) UserFatal(err error)
- func (l *Logger) UserFatalMessage(err error) string
- func (l *Logger) Warn(err error)
- func (l *Logger) WarnUnique(err error)
- func (l *Logger) Wrapf(err error, format string, args ...any) error
- func (l *Logger) Write(p []byte) (n int, err error)
- type OutputError
- type Replacement
- type Runner
- type UserError
- type UserWarning
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckDirectory ¶
CheckDirectory checks if a directory exists otherwise returns an error
func CheckDirectoryOrCreate ¶
func CopyDirectory ¶
CopyDirectory recursively copies a directory
func CopyFileWithReplacement ¶
func CopyFileWithReplacement(from string, to string, replacements []Replacement) error
func CreateDirIf ¶
func ExitOnError ¶
func FileExists ¶
func ForwardLogs ¶
func ForwardLogs(r io.ReadCloser, w io.Writer)
func GenerateTree ¶
GenerateTree recursively generates a string representation of the directory tree
func HandleError ¶
func HandleError(err error)
func IsOutputError ¶
func IsUserError ¶
func IsUserWarning ¶
func NewOutputError ¶
func NewUserWarning ¶
func ParseError ¶
func UnexpectedExitOnError ¶
func UserErrorMessage ¶
func UserWarnMessage ¶
Types ¶
type BaseLogger ¶
type BaseLogger interface { Write(p []byte) (n int, err error) SetLevel(lvl LogLevel) Info(format string, args ...any) Tracef(format string, args ...any) Debugf(format string, args ...any) DebugMe(format string, args ...any) TODO(format string, args ...any) Wrapf(err error, format string, args ...any) error Errorf(format string, args ...any) error }
BaseLogger is the Minimum logger interface
type CopyInstruction ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
func (*File) RelativePath ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) IfNot ¶
func (l *Logger) IfNot(base BaseLogger) BaseLogger
func (*Logger) UserFatalMessage ¶
func (*Logger) WarnUnique ¶ added in v0.0.9
type OutputError ¶
type OutputError struct {
// contains filtered or unexported fields
}
func (*OutputError) Error ¶
func (u *OutputError) Error() string
type Replacement ¶
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
func NewRunner ¶
func NewRunner(bin string, dir Dir, args []string, out BaseLogger, override BaseLogger) *Runner
type UserWarning ¶
type UserWarning struct {
// contains filtered or unexported fields
}
func (*UserWarning) Error ¶
func (u *UserWarning) Error() string
Click to show internal directories.
Click to hide internal directories.