Documentation ¶
Index ¶
- Constants
- func ByteCountSI(b uint64) string
- func FilterCommonRootDirs(strSlice []string) []string
- func FilterSlicePfxStr(s []string) []string
- func InSlice(item interface{}, slice interface{}) bool
- func PosInSlice(item interface{}, slice interface{}) int
- func RemoveFromStringSlice(item string, slice []string) []string
- func SlicesEqual(a, b interface{}) bool
- func WriteToYaml(filePath string, object interface{}, perm fs.FileMode) error
- type Errors
- func (e *Errors) AddIf(err error) error
- func (e *Errors) AddMsgf(format string, param ...interface{}) error
- func (e *Errors) AddMsgs(message ...string)
- func (e *Errors) Append(errs *Errors) *Errors
- func (e *Errors) Err() error
- func (e *Errors) ErrString() string
- func (e *Errors) ErrStrings() []string
- type TSimpleSLQ
- func (s *TSimpleSLQ) Append(item interface{}) interface{}
- func (s *TSimpleSLQ) Contains(item interface{}) bool
- func (s *TSimpleSLQ) CurrentItem() interface{}
- func (s *TSimpleSLQ) IndexOf(item interface{}) int
- func (s *TSimpleSLQ) InsertAt(item interface{}, pos int) interface{}
- func (s *TSimpleSLQ) ItemAt(pos int) interface{}
- func (s *TSimpleSLQ) Length() int
- func (s *TSimpleSLQ) Next() bool
- func (s *TSimpleSLQ) Pop() interface{}
- func (s *TSimpleSLQ) Prev() bool
- func (s *TSimpleSLQ) Push(item interface{}) interface{}
Constants ¶
const Version = "v0.4.0"
Version exposes the current package version.
Variables ¶
This section is empty.
Functions ¶
func ByteCountSI ¶
from https://yourbasic.org/golang/formatting-byte-size-to-human-readable-format/ ByteCountSI returns the "human readable" number of bytes in SI units (as a string)
func FilterCommonRootDirs ¶
FilterCommonRootDirs recursively filters out paths for which any higher root path exists in the same slice
func FilterSlicePfxStr ¶
FilterSlicePfxStr filters out all string items of which another slice member is a prefix, recursively by convention take the first element as the "pivot"
func InSlice ¶
func InSlice(item interface{}, slice interface{}) bool
InSlice returns true if item is in list and false otherwise
func PosInSlice ¶
func PosInSlice(item interface{}, slice interface{}) int
PosInSlice returns the position of item in slice or -1 if not found
func RemoveFromStringSlice ¶
RemoveFromStringSlice removes the itmen and returns a new slice
func SlicesEqual ¶
func SlicesEqual(a, b interface{}) bool
Equal tells whether a and b contain the same elements in the same order (!) A nil argument is equivalent to an empty slice.
Types ¶
type Errors ¶
type Errors struct {
// contains filtered or unexported fields
}
func (*Errors) ErrStrings ¶
type TSimpleSLQ ¶
type TSimpleSLQ struct {
// contains filtered or unexported fields
}
func NewSimpleSLQ ¶
func NewSimpleSLQ() *TSimpleSLQ
NewSimpleSLQ contsructor SimpleSLQ is a experimental, generic "Slice/List/Queue" hybrid like structure based on slice that implements:
Pop/Push, Next/Prev, IndexOf, ...
func (*TSimpleSLQ) Append ¶
func (s *TSimpleSLQ) Append(item interface{}) interface{}
func (*TSimpleSLQ) Contains ¶
func (s *TSimpleSLQ) Contains(item interface{}) bool
func (*TSimpleSLQ) CurrentItem ¶
func (s *TSimpleSLQ) CurrentItem() interface{}
func (*TSimpleSLQ) IndexOf ¶
func (s *TSimpleSLQ) IndexOf(item interface{}) int
func (*TSimpleSLQ) InsertAt ¶
func (s *TSimpleSLQ) InsertAt(item interface{}, pos int) interface{}
func (*TSimpleSLQ) ItemAt ¶
func (s *TSimpleSLQ) ItemAt(pos int) interface{}
func (*TSimpleSLQ) Length ¶
func (s *TSimpleSLQ) Length() int
func (*TSimpleSLQ) Next ¶
func (s *TSimpleSLQ) Next() bool
func (*TSimpleSLQ) Pop ¶
func (s *TSimpleSLQ) Pop() interface{}
func (*TSimpleSLQ) Prev ¶
func (s *TSimpleSLQ) Prev() bool
func (*TSimpleSLQ) Push ¶
func (s *TSimpleSLQ) Push(item interface{}) interface{}