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 StringsToErrors(str []string) []error
- func Strip(str string) string
- type AlreadyManiDirectory
- type ConfigEnvFailed
- type ConfigErr
- type ConfigNotFound
- type DescribeFlags
- type DirNotFound
- type FailedToOpenFile
- type FailedToParsePath
- type InitFlags
- type ListFlags
- type NoTargets
- type PathDoesNotExist
- type Prefixer
- type ProjectFlags
- type ProjectNotFound
- type RunFlags
- type SetProjectFlags
- type SetRunFlags
- type SetSyncFlags
- type SizedWaitGroup
- type SpecNotFound
- type SpecOutputError
- type SyncFlags
- type TUIFlags
- type TagExprInvalid
- type TagFlags
- type TagNotFound
- type TargetNotFound
- type TargetTagsExprError
- type TaskFlags
- type TaskNotFound
- type ThemeNotFound
- type ZeroNotAllowed
Constants ¶
const ANSI = "" /* 129-byte string literal not displayed */
Variables ¶
var ConfigMan []byte
var ConfigMd []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 ¶ added in v0.31.2
func GetWdRemoteURL ¶ added in v0.31.2
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 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 DescribeFlags ¶ added in v0.30.0
type DescribeFlags struct {
Theme 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 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 RunFlags ¶ added in v0.10.0
type RunFlags struct {
Edit bool
Parallel bool
DryRun bool
Silent bool
Describe bool
Cwd bool
TTY bool
Theme string
Target string
Spec string
All bool
Projects []string
Paths []string
Tags []string
TagsExpr string
IgnoreErrors bool
IgnoreNonExisting bool
OmitEmptyRows bool
OmitEmptyColumns bool
Output string
Forks uint32
}
type SetProjectFlags ¶ added in v0.30.0
type SetRunFlags ¶ added in v0.20.0
type SetSyncFlags ¶ added in v0.30.0
type SizedWaitGroup ¶ added in v0.20.1
type SizedWaitGroup struct {
Size uint32
// 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 uint32) 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 SpecOutputError ¶ added in v0.30.0
func (*SpecOutputError) Error ¶ added in v0.30.0
func (c *SpecOutputError) Error() string
type TagExprInvalid ¶ added in v0.30.0
type TagExprInvalid struct {
Expression string
}
func (*TagExprInvalid) Error ¶ added in v0.30.0
func (c *TagExprInvalid) 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 TargetTagsExprError ¶ added in v0.30.0
func (*TargetTagsExprError) Error ¶ added in v0.30.0
func (c *TargetTagsExprError) 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
type ZeroNotAllowed ¶ added in v0.30.0
type ZeroNotAllowed struct {
Name string
}
func (*ZeroNotAllowed) Error ¶ added in v0.30.0
func (c *ZeroNotAllowed) Error() string