Documentation ¶
Overview ¶
Source: https://github.com/goware/prefixer Author: goware
Index ¶
- Constants
- Variables
- func CheckIfError(err error)
- func CreateManPage(desc string, version string, date string, rootCmd *cobra.Command, ...) error
- func DebugPrint(data any)
- func Exit(err error)
- func FindFileInParentDirs(path string, files []string) (string, error)
- func FormatShell(shell string) string
- func FormatShellString(shell string, command string) (string, []string)
- func GenManPages(dir string) error
- func GetAbsolutePath(configDir string, path string, name string) (string, error)
- func GetRelativePath(configDir string, path string) (string, error)
- func GetRemoteUrl(path string) (string, error)
- func GetWdRemoteUrl(path string) (string, error)
- func Intersection(a []string, b []string) []string
- func Ptr[T any](t T) *T
- func ResolveTildePath(path string) (string, error)
- func StringInSlice(a string, list []string) bool
- func StringsToErrors(str []string) []error
- func Strip(str string) string
- type AlreadyManiDirectory
- type ConfigEnvFailed
- type ConfigErr
- type ConfigNotFound
- type DirNotFound
- type FailedToOpenFile
- type FailedToParseFile
- type FailedToParsePath
- type InitFlags
- type ListFlags
- type PathDoesNotExist
- type Prefixer
- type ProjectFlags
- type ProjectNotFound
- type RunFlags
- type SetRunFlags
- type SizedWaitGroup
- type SpecNotFound
- type SyncFlags
- type TagFlags
- type TagNotFound
- type TargetNotFound
- type TaskFlags
- type TaskNotFound
- type ThemeNotFound
Constants ¶
const ANSI = "" /* 129-byte string literal not displayed */
Variables ¶
var CONFIG_MAN []byte
var CONFIG_MD []byte
var RE = regexp.MustCompile(ANSI)
Functions ¶
func CheckIfError ¶
func CheckIfError(err error)
func CreateManPage ¶ added in v0.20.0
func DebugPrint ¶ added in v0.6.1
func DebugPrint(data any)
func FindFileInParentDirs ¶ added in v0.5.0
func FormatShell ¶ added in v0.12.0
FormatShell returns the shell program and associated command flag
func FormatShellString ¶ added in v0.20.0
FormatShellString returns the shell program (bash,sh,.etc) along with the command flag and subsequent commands Example: "bash", "-c echo hello world"
func GenManPages ¶ added in v0.20.0
func GetAbsolutePath ¶
Get the absolute path Need to support following path types:
lala/land ./lala/land ../lala/land /lala/land $HOME/lala/land ~/lala/land ~root/lala/land
func GetRelativePath ¶ added in v0.10.0
func GetRemoteUrl ¶
func GetWdRemoteUrl ¶
func Intersection ¶ added in v0.5.0
func Ptr ¶ added in v0.20.0
func Ptr[T any](t T) *T
Used when creating pointers to literal. Useful when you want set/unset attributes.
func ResolveTildePath ¶ added in v0.20.1
Get the absolute path Need to support following path types:
lala/land ./lala/land ../lala/land /lala/land $HOME/lala/land ~/lala/land ~root/lala/land
func StringInSlice ¶
func StringsToErrors ¶ added in v0.20.0
Types ¶
type AlreadyManiDirectory ¶ added in v0.20.0
type AlreadyManiDirectory struct {
Dir string
}
func (*AlreadyManiDirectory) Error ¶ added in v0.20.0
func (c *AlreadyManiDirectory) Error() string
type ConfigEnvFailed ¶ added in v0.6.1
func (*ConfigEnvFailed) Error ¶ added in v0.6.1
func (c *ConfigEnvFailed) Error() string
type ConfigNotFound ¶
type ConfigNotFound struct {
Names []string
}
func (*ConfigNotFound) Error ¶
func (f *ConfigNotFound) Error() string
type DirNotFound ¶ added in v0.10.0
type DirNotFound struct {
Dirs []string
}
func (*DirNotFound) Error ¶ added in v0.10.0
func (c *DirNotFound) Error() string
type FailedToOpenFile ¶
type FailedToOpenFile struct {
Name string
}
func (*FailedToOpenFile) Error ¶
func (f *FailedToOpenFile) Error() string
type FailedToParseFile ¶
func (*FailedToParseFile) Error ¶
func (f *FailedToParseFile) Error() string
type FailedToParsePath ¶
type FailedToParsePath struct {
Name string
}
func (*FailedToParsePath) Error ¶
func (f *FailedToParsePath) Error() string
type PathDoesNotExist ¶
type PathDoesNotExist struct {
Path string
}
func (*PathDoesNotExist) Error ¶
func (p *PathDoesNotExist) Error() string
type Prefixer ¶ added in v0.20.0
type Prefixer struct {
// contains filtered or unexported fields
}
Prefixer implements io.Reader and io.WriterTo. It reads data from the underlying reader and prepends every line with a given string.
func NewPrefixer ¶ added in v0.20.0
New creates a new instance of Prefixer.
type ProjectFlags ¶ added in v0.10.0
type ProjectNotFound ¶ added in v0.10.0
type ProjectNotFound struct {
Name []string
}
func (*ProjectNotFound) Error ¶ added in v0.10.0
func (c *ProjectNotFound) Error() string
type SetRunFlags ¶ added in v0.20.0
type SizedWaitGroup ¶ added in v0.20.1
type SizedWaitGroup struct { Size int // contains filtered or unexported fields }
SizedWaitGroup has the same role and close to the same API as the Golang sync.WaitGroup but adds a limit of the amount of goroutines started concurrently.
func NewSizedWaitGroup ¶ added in v0.20.1
func NewSizedWaitGroup(limit int) SizedWaitGroup
New creates a SizedWaitGroup. The limit parameter is the maximum amount of goroutines which can be started concurrently.
func (*SizedWaitGroup) Add ¶ added in v0.20.1
func (s *SizedWaitGroup) Add()
Add increments the internal WaitGroup counter. It can be blocking if the limit of spawned goroutines has been reached. It will stop blocking when Done is been called.
See sync.WaitGroup documentation for more information.
func (*SizedWaitGroup) AddWithContext ¶ added in v0.20.1
func (s *SizedWaitGroup) AddWithContext(ctx context.Context) error
AddWithContext increments the internal WaitGroup counter. It can be blocking if the limit of spawned goroutines has been reached. It will stop blocking when Done is been called, or when the context is canceled. Returns nil on success or an error if the context is canceled before the lock is acquired.
See sync.WaitGroup documentation for more information.
func (*SizedWaitGroup) Done ¶ added in v0.20.1
func (s *SizedWaitGroup) Done()
Done decrements the SizedWaitGroup counter. See sync.WaitGroup documentation for more information.
func (*SizedWaitGroup) Wait ¶ added in v0.20.1
func (s *SizedWaitGroup) Wait()
Wait blocks until the SizedWaitGroup counter is zero. See sync.WaitGroup documentation for more information.
type SpecNotFound ¶ added in v0.12.0
type SpecNotFound struct {
Name string
}
func (*SpecNotFound) Error ¶ added in v0.12.0
func (c *SpecNotFound) Error() string
type TagNotFound ¶ added in v0.20.0
type TagNotFound struct {
Tags []string
}
func (*TagNotFound) Error ¶ added in v0.20.0
func (c *TagNotFound) Error() string
type TargetNotFound ¶ added in v0.12.0
type TargetNotFound struct {
Name string
}
func (*TargetNotFound) Error ¶ added in v0.12.0
func (c *TargetNotFound) Error() string
type TaskNotFound ¶ added in v0.6.1
type TaskNotFound struct {
Name []string
}
func (*TaskNotFound) Error ¶ added in v0.6.1
func (c *TaskNotFound) Error() string
type ThemeNotFound ¶ added in v0.10.0
type ThemeNotFound struct {
Name string
}
func (*ThemeNotFound) Error ¶ added in v0.10.0
func (c *ThemeNotFound) Error() string