Documentation ¶
Index ¶
- Constants
- func CheckDirectory(path string) error
- func CheckDirectoryOrCreate(path string) error
- func CheckEmptyDirectoryOrCreate(path string) error
- func Confirm(s string) bool
- 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 DirectoryExists(p string) bool
- func Exit(msg string, args ...any)
- func ExitOnError(err error, msg string, args ...any)
- func ExitOnFalse(b bool, 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 MultiErrors(errs ...error) error
- func NewOutputError(format string, args ...any) error
- func NewUserWarning(format string, args ...any) error
- func Override() bool
- func ParseError(s string) error
- func RequireExec(bins ...string) ([]string, bool)
- func SetDebug(d bool)
- func SetOverride(o 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 ConfirmModel
- type ContextLoggerKey
- type CopyInstruction
- type Dir
- type DirReader
- type FSReader
- func (fr *FSReader) Absolute(dir Dir) string
- func (fr *FSReader) AbsoluteDir(dir Dir) string
- func (fr *FSReader) AbsoluteFile(f File) string
- func (fr *FSReader) At(root string) *FSReader
- func (fr *FSReader) Copy(s string, file string) error
- func (fr *FSReader) ReadDir(dir Dir) ([]os.DirEntry, error)
- func (fr *FSReader) ReadFile(f File) ([]byte, error)
- type File
- type FileSystem
- 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 S
- type UserError
- type UserWarning
Constants ¶
View Source
const ( Agent = ContextLoggerKey("agent") Service = ContextLoggerKey("service") )
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 DirectoryExists ¶ added in v0.0.13
func ExitOnError ¶
func ExitOnFalse ¶ added in v0.0.16
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 MultiErrors ¶ added in v0.0.13
func NewOutputError ¶
func NewUserWarning ¶
func ParseError ¶
func RequireExec ¶ added in v0.0.15
func SetOverride ¶ added in v0.0.13
func SetOverride(o bool)
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
func AgentLogger ¶ added in v0.0.31
func AgentLogger(ctx context.Context) BaseLogger
type ConfirmModel ¶ added in v0.0.21
type ConfirmModel struct { Prompt string // contains filtered or unexported fields }
func (ConfirmModel) Init ¶ added in v0.0.21
func (m ConfirmModel) Init() tea.Cmd
func (ConfirmModel) View ¶ added in v0.0.21
func (m ConfirmModel) View() string
type ContextLoggerKey ¶ added in v0.0.13
type ContextLoggerKey string
type CopyInstruction ¶
type DirReader ¶ added in v0.0.13
type DirReader struct {
// contains filtered or unexported fields
}
func NewDirReader ¶ added in v0.0.13
func NewDirReader() *DirReader
func (*DirReader) AbsoluteDir ¶ added in v0.0.13
func (*DirReader) AbsoluteFile ¶ added in v0.0.13
type FSReader ¶ added in v0.0.13
func (*FSReader) AbsoluteDir ¶ added in v0.0.13
func (*FSReader) AbsoluteFile ¶ added in v0.0.13
type File ¶
type File struct {
// contains filtered or unexported fields
}
func (*File) RelativePath ¶
type FileSystem ¶ added in v0.0.13
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 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.