core

package
v0.31.2 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Source: https://github.com/goware/prefixer Author: goware

Index

Constants

View Source
const ANSI = "" /* 129-byte string literal not displayed */

Variables

View Source
var ConfigMan []byte
View Source
var ConfigMd []byte

Functions

func CheckIfError

func CheckIfError(err error)

func CreateManPage added in v0.20.0

func CreateManPage(desc string, version string, date string, rootCmd *cobra.Command, cmds ...*cobra.Command) error

func DebugPrint added in v0.6.1

func DebugPrint(data any)

func Exit added in v0.22.0

func Exit(err error)

func FindFileInParentDirs added in v0.5.0

func FindFileInParentDirs(path string, files []string) (string, error)

func FormatShell added in v0.12.0

func FormatShell(shell string) string

FormatShell returns the shell program and associated command flag

func FormatShellString added in v0.20.0

func FormatShellString(shell string, command string) (string, []string)

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 GenManPages(dir string) error

func GetAbsolutePath

func GetAbsolutePath(configDir string, path string, name string) (string, error)

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 GetRelativePath(configDir string, path string) (string, error)

func GetRemoteURL added in v0.31.2

func GetRemoteURL(path string) (string, error)

func GetWdRemoteURL added in v0.31.2

func GetWdRemoteURL(path string) (string, error)

func Intersection added in v0.5.0

func Intersection(a []string, b []string) []string

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

func ResolveTildePath(path string) (string, error)

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

func StringsToErrors(str []string) []error

func Strip added in v0.10.0

func Strip(str string) string

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

type ConfigEnvFailed struct {
	Name string
	Err  string
}

func (*ConfigEnvFailed) Error added in v0.6.1

func (c *ConfigEnvFailed) Error() string

type ConfigErr added in v0.20.0

type ConfigErr struct {
	Msg string
}

func (*ConfigErr) Error added in v0.20.0

func (f *ConfigErr) 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 InitFlags added in v0.10.0

type InitFlags struct {
	AutoDiscovery bool
	SyncGitignore bool
}

type ListFlags added in v0.10.0

type ListFlags struct {
	Output string
	Theme  string
	Tree   bool
}

type NoTargets added in v0.30.0

type NoTargets struct{}

func (*NoTargets) Error added in v0.30.0

func (c *NoTargets) 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

func NewPrefixer(r io.Reader, prefix string) *Prefixer

New creates a new instance of Prefixer.

func (*Prefixer) Read added in v0.20.0

func (r *Prefixer) Read(p []byte) (n int, err error)

Read implements io.Reader. It reads data into p from the underlying reader and prepends every line with a prefix. It does not block if no data is available yet. It returns the number of bytes read into p.

func (*Prefixer) WriteTo added in v0.20.0

func (r *Prefixer) WriteTo(w io.Writer) (n int64, err error)

type ProjectFlags added in v0.10.0

type ProjectFlags struct {
	All      bool
	Cwd      bool
	Tags     []string
	TagsExpr string
	Paths    []string
	Projects []string
	Target   string
	Headers  []string
	Edit     bool
}

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 SetProjectFlags struct {
	All    bool
	Cwd    bool
	Target bool
}

type SetRunFlags added in v0.20.0

type SetRunFlags struct {
	TTY bool

	All bool
	Cwd bool

	Parallel          bool
	OmitEmptyColumns  bool
	OmitEmptyRows     bool
	IgnoreErrors      bool
	IgnoreNonExisting bool
	Forks             bool
}

type SetSyncFlags added in v0.30.0

type SetSyncFlags struct {
	Parallel      bool
	SyncGitignore bool
	SyncRemotes   bool
	Forks         bool
}

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

type SpecOutputError struct {
	Name   string
	Output string
}

func (*SpecOutputError) Error added in v0.30.0

func (c *SpecOutputError) Error() string

type SyncFlags added in v0.10.0

type SyncFlags struct {
	IgnoreSyncState bool
	Parallel        bool
	SyncGitignore   bool
	Status          bool
	SyncRemotes     bool
	Forks           uint32
}

type TUIFlags added in v0.30.0

type TUIFlags struct {
	Theme  string
	Reload bool
}

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 TagFlags added in v0.10.0

type TagFlags struct {
	Headers []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

type TargetTagsExprError struct {
	Name string
	Err  error
}

func (*TargetTagsExprError) Error added in v0.30.0

func (c *TargetTagsExprError) Error() string

type TaskFlags added in v0.10.0

type TaskFlags struct {
	Headers []string
	Edit    bool
}

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

Directories

Path Synopsis
Package dao for evaluating boolean tag expressions against project tags.
Package dao for evaluating boolean tag expressions against project tags.
tui

Jump to

Keyboard shortcuts

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