Documentation
¶
Index ¶
- func Coalesce[T comparable](vs ...T) T
- func FileExists(path string) (bool, error)
- func FindGitIgnore(path string) (func(string) bool, error)
- func First[T any](l []T) T
- func FirstUpper(str string) string
- func IIf[T any](test bool, ifTrue, ifFalse T) T
- func In[T comparable](v T, cs ...T) bool
- func IsTextFile(path string) (bool, error)
- func IsTextReader(reader io.ReadCloser, err error) (bool, error)
- func IsTextReaderOpts(reader io.ReadCloser, err error, sampleLines int) (bool, error)
- func IsTrue(v string) bool
- func Last[T any](l []T) T
- func ListFilesRecursive(rootDir string, matcher func(name string) bool) ([]string, error)
- func MapContains[K comparable, V any](m map[K]V, k K) bool
- func MapKeysHaveIntersection[K comparable, V1 any, V2 any](m1 map[K]V1, m2 map[K]V2) bool
- func MapMapContains[K1, K2 comparable, V any](m1 map[K1]map[K2]V, k1 K1, k2 K2) bool
- func Max[T constraints.Ordered](a T, bs ...T) T
- func Min[T constraints.Ordered](a T, bs ...T) T
- func NewProgressBar(total int) *progressbar.ProgressBar
- func PathAbs(paths ...string) (string, error)
- func RemoveLast[T any](l []T) []T
- func Take[T any](l []T, i int) []T
- func TruncateFilename(name string) string
- type ParallelOptions
- type ProcessGroup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Coalesce ¶
func Coalesce[T comparable](vs ...T) T
func FileExists ¶
func FirstUpper ¶
func In ¶
func In[T comparable](v T, cs ...T) bool
func IsTextFile ¶
func IsTextReader ¶
func IsTextReader(reader io.ReadCloser, err error) (bool, error)
func IsTextReaderOpts ¶
func ListFilesRecursive ¶
func MapContains ¶
func MapContains[K comparable, V any](m map[K]V, k K) bool
func MapKeysHaveIntersection ¶
func MapKeysHaveIntersection[K comparable, V1 any, V2 any](m1 map[K]V1, m2 map[K]V2) bool
func MapMapContains ¶
func MapMapContains[K1, K2 comparable, V any](m1 map[K1]map[K2]V, k1 K1, k2 K2) bool
func Max ¶
func Max[T constraints.Ordered](a T, bs ...T) T
func Min ¶
func Min[T constraints.Ordered](a T, bs ...T) T
func NewProgressBar ¶
func NewProgressBar(total int) *progressbar.ProgressBar
func RemoveLast ¶
func RemoveLast[T any](l []T) []T
func TruncateFilename ¶
Types ¶
type ParallelOptions ¶
type ProcessGroup ¶
type ProcessGroup[I, O any] struct { Input chan I Output chan O Err chan error // contains filtered or unexported fields }
func NewProcessGroup ¶
func NewProcessGroup[I, O any](proc func(I) (O, error), opts ...ParallelOptions) *ProcessGroup[I, O]
func ParallelFor ¶
func ParallelFor[T, O any](col []T, proc func(T) (O, error), opts ...ParallelOptions) *ProcessGroup[T, O]
func (*ProcessGroup[I, O]) Abort ¶
func (g *ProcessGroup[I, O]) Abort(err error)
func (*ProcessGroup[I, O]) Aborted ¶
func (g *ProcessGroup[I, O]) Aborted() bool
func (*ProcessGroup[I, O]) Close ¶
func (g *ProcessGroup[I, O]) Close()
func (*ProcessGroup[I, O]) Error ¶
func (g *ProcessGroup[I, O]) Error() error
func (*ProcessGroup[I, O]) FinishedInput ¶
func (g *ProcessGroup[I, O]) FinishedInput()
Click to show internal directories.
Click to hide internal directories.