genLib

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2019 License: MIT, MIT Imports: 38 Imported by: 0

Documentation

Overview

/ +build OMIT

csvfunc.go

Index

Constants

View Source
const (
	OS_READ        = 04
	OS_WRITE       = 02
	OS_EX          = 01
	OS_USER_SHIFT  = 6
	OS_GROUP_SHIFT = 3
	OS_OTH_SHIFT   = 0

	OS_USER_R   = OS_READ << OS_USER_SHIFT
	OS_USER_W   = OS_WRITE << OS_USER_SHIFT
	OS_USER_X   = OS_EX << OS_USER_SHIFT
	OS_USER_RW  = OS_USER_R | OS_USER_W
	OS_USER_RWX = OS_USER_RW | OS_USER_X

	OS_GROUP_R   = OS_READ << OS_GROUP_SHIFT
	OS_GROUP_W   = OS_WRITE << OS_GROUP_SHIFT
	OS_GROUP_X   = OS_EX << OS_GROUP_SHIFT
	OS_GROUP_RW  = OS_GROUP_R | OS_GROUP_W
	OS_GROUP_RWX = OS_GROUP_RW | OS_GROUP_X

	OS_OTH_R   = OS_READ << OS_OTH_SHIFT
	OS_OTH_W   = OS_WRITE << OS_OTH_SHIFT
	OS_OTH_X   = OS_EX << OS_OTH_SHIFT
	OS_OTH_RW  = OS_OTH_R | OS_OTH_W
	OS_OTH_RWX = OS_OTH_RW | OS_OTH_X

	OS_ALL_R   = OS_USER_R | OS_GROUP_R | OS_OTH_R
	OS_ALL_W   = OS_USER_W | OS_GROUP_W | OS_OTH_W
	OS_ALL_X   = OS_USER_X | OS_GROUP_X | OS_OTH_X
	OS_ALL_RW  = OS_ALL_R | OS_ALL_W
	OS_ALL_RWX = OS_ALL_RW | OS_ALL_X
)
Const for FileMode

Usage to Create any directories needed to put this file in them:

     var dir_file_mode os.FileMode
     dir_file_mode = os.ModeDir | (OS_USER_RWX | OS_ALL_R)
     os.MkdirAll(dir_str, dir_file_mode)

	fmt.Printf("%o\n%o\n%o\n%o\n",
		os.ModePerm&OS_ALL_RWX,
		os.ModePerm&OS_USER_RW|OS_GROUP_R|OS_OTH_R,
		os.ModePerm&OS_USER_RW|OS_GROUP_RW|OS_OTH_R,
		os.ModePerm&OS_USER_RWX|OS_GROUP_RWX|OS_OTH_R)

Variables

This section is empty.

Functions

func AppendAt

func AppendAt(slice []string, pos int, insert ...string) []string

AppendAt: Add data at a specified position in slice of a string

func BaseNoExt

func BaseNoExt(filename string) (outFilename string)

BaseNoExt: get only the name without ext.

func BinFilesToHexFile

func BinFilesToHexFile(outFilename string, assets []VarFile, doBackup bool) (err error)

BinFilesToHexFile: Convert binary files to gzipped []byte in specific file. Much faster than the previous version that only deals with one file at a time.

func BinToHexString

func BinToHexString(filename string) (outString string, err error)

BinToHex: Convert binary file to gzipped []byte

func Bpcheck

func Bpcheck(val1, val2 int, pos ...int)

Breakpoint check TODO adding function caller

func ByteCountBinary

func ByteCountBinary(b int64) string

ByteCountBinary: Format byte size to human readable format

func ByteCountDecimal

func ByteCountDecimal(b int64) string

ByteCountDecimal: Format byte size to human readable format

func ByteToHexStr

func ByteToHexStr(bytes []byte) string

ByteToHexStr: Convert []byte to hexString

func CharsetToUtf8

func CharsetToUtf8(str string) string

Get charset and convert to utf-8 if needed

func Check

func Check(err error, message ...string) (state bool)

Check: Display error messages in HR version with onClickJump enabled in my favourite Golang IDE editor. Return true if error exist.

func CheckCmd

func CheckCmd(cmd string) bool

CheckCmd: Check for command if exist

func CheckE

func CheckE(err error, message ...string)

Check error function, and exit if error, input message is optional or accept multiple arguments.

func CheckForDupSl2d

func CheckForDupSl2d(sl [][]string) bool

CheckForDupSl2d: Return true if duplicated row is found

func CheckMime

func CheckMime(filename string) (mime string, err error)

CheckMime: return the mime type of a file

func CmpRemSl2d

func CmpRemSl2d(sl1, sl2 [][]string) (outSlice [][]string)

CmpRemSl2d: Compare slice1 and slice2 if row exist on both, the raw is removed from slice2 and result returned.

func CopyFile

func CopyFile(inFile, outFile string, doBackup ...bool) (err error)

CopyFile:

func CreateTarballGzip

func CreateTarballGzip(tarballFilePath string, filePaths []string, compressLvl int) (countedWrittenFiles int, err error)

CreateTarball: create tar.gz file from given filenames. -2 = HuffmanOnly (linear compression, low gain, fast compression) -1 = DefaultCompression

0 = NoCompression
1 -> 9 = BestSpeed -> BestCompression

func CreateTarballXz

func CreateTarballXz(tarballFilePath string, filePaths []string, compressLvl int) (countedWrittenFiles int, err error)

CreateTarballLXz: create tar.xz file from given filenames. Just for fun test ... but it's really slow, no multi-threading and low size gain.

func DeleteSl

func DeleteSl(slice []string, pos int) []string

DeleteSl: Delete value at specified position in string slice

func DeleteSl1

func DeleteSl1(slice []string, pos int) []string

DeleteSl1: Delete value at specified position in string slice

func DetectCharsetFile

func DetectCharsetFile(filename string) (name string)

Detect encoding type for files

func DetectCharsetStr

func DetectCharsetStr(inputStr string) (name string)

Detect encoding type for strings

func DispRights

func DispRights(value int)

DispRights: display right. i.e: g.DispRights(g.OS_USER_RWX | g.OS_GROUP_RWX | g.OS_OTH_R)

func ExecCommand

func ExecCommand(commands string, args ...string) (output []byte, err error)

ExecCommand: launch commandline application with arguments return output and error.

func ExtEnsure

func ExtEnsure(filename, ext string) (outFilename string)

ExtEnsure: ensure the filename have desired extension

func FileCharsetSwitch

func FileCharsetSwitch(inCharset, outCharset, inFilename string, outFilename ...string)

Change charset of a text file

func FileExist

func FileExist(name string) bool

FileExist: reports whether the named file or directory exists.

func FindDate

func FindDate(inputString, fmtDate string) []string

Find the date in relation to the given format. (French format like %d, %m, %y or Y%). input fmtDate: "%d-%m-%y %H:%M:%S"

func FindDir

func FindDir(dir, mask string, returnedStrSlice *[][]string, scanSub, showDir, followSymlinkDir bool) error

FindDir retrieve file in a specific directory with more options.

func FormatDate

func FormatDate(fmtDate string, inpDate string) time.Time

Change date format to unix model with pattern like: fmtDate:='%d-%m-%y %H:%M:%S' --> '$y-%m-%d %H:%M:%S' Note: year format must be in lowercase ...

func FormatText

func FormatText(str string, max int, truncateWordOverMaxSize bool, indenT ...string) string

FormatText: Format words text to fit (column/windows with limited width) "max" chars. An unwanted behavior may occur on string where word's length > max...

func FormatTextParagraphFormatting

func FormatTextParagraphFormatting(str string, max int, truncateWordOverMaxSize bool, indentFirstLinetr ...string) string

FormatTextParagraphFormatting:

func FormatTextQuoteBlankLines

func FormatTextQuoteBlankLines(str string) (out string)

An unwanted behavior may occur on string where word's length > max...

func GenFileName

func GenFileName() string

GenFileName: Generate a randomized file name

func GenericReader

func GenericReader(filename string) (io.Reader, *os.File, error)

GenericReader: return io.reader for standar files and .bz2, gz.

func GetCurrentDir

func GetCurrentDir() (dir string, err error)

GetCurrentDir: Get current directory

func GetFileBytesString

func GetFileBytesString(filename string, from, to int) (outString string)

GetFileBytesString: Retrieve 'from' 'to' bytes from file in string format.

func GetFileEOL

func GetFileEOL(filename string) (outString string, err error)

GetFileEOL: Open file and get (CR, LF, CRLF) > string or get OS line end.

func GetFileMime

func GetFileMime(filename string) string

GetFileMime: scan first bytes to detect mime type of file.

func GetOsLineEnd

func GetOsLineEnd() string

GetOsLineEnd: Get current OS line-feed

func GetOsPathSep

func GetOsPathSep() string

GetOsPathSep: Get OS path separator

func GetSep

func GetSep(str string) []string

Get separator char

func GetStdin

func GetStdin(ask string) (input string)

Get input from commandline stdin

func GetStrIndex

func GetStrIndex(slice []string, item string) int

GetStrIndex: Get index of a string in a slice, Return -1 if no entry found ...

func GetStrIndex2dCol

func GetStrIndex2dCol(slice [][]string, value string, col int) int

GetStrIndex2dCol: Search in 2d string slice if a column's value exist and return row number.

func GetTextEOL

func GetTextEOL(inTextBytes []byte) (outString string)

GetTextEOL: Get EOL from text bytes (CR, LF, CRLF) > string or get OS line end.

func GetUser

func GetUser() (realUser, currentUser *user.User, err error)

GetUser: retrieve realUser and currentUser.

func GoFormatting

func GoFormatting(filename string)

goFormatting: Format output file using gofmt function.

func Gzip

func Gzip(source, target string) error

Gzip: Pack file

func HexToBytes

func HexToBytes(varPath string, gzipData []byte) (outByte []byte)

HexToBytes: Convert Gzip Hex to []byte used for embedded binary in source code

func Increment

func Increment(inSL []string, separator string, startAt int, atLeft ...bool) (outSL []string)

Increment: Add incrementation to filename

func IsDate

func IsDate(inString string) bool

IsDate: Check if string is date

func IsDirEmpty

func IsDirEmpty(name string) (empty bool, err error)

IsDirEmpty:

func IsError

func IsError(err error) bool

Check error and return true if error exist

func IsExist2d

func IsExist2d(slice [][]string, cmpRow []string) bool

IsExist2d Search in 2d string slice if a row exist.

func IsExist2dCol

func IsExist2dCol(slice [][]string, value string, col int) bool

IsExist2dCol: Search in 2d string slice if a column's value exist.

func IsExistSl

func IsExistSl(slice []string, item string) bool

IsExistSl: if exist then ...

func IsFloat

func IsFloat(inString string) bool

IsFloat: Check if string is float

func IsTextFile

func IsTextFile(filename string) (fileType string, err error)

IsTextFile: check for first 512 bytes if they contains some bytes usually present in utf-32, utf-16 or ascii/utf-8 files. Return detected type, including binary.

func JsonRead

func JsonRead(filename string, interf interface{}) (err error)

JsonRead: datas from file to given interface / structure i.e: err := ReadJson(filename, &person) remember to put upper char at left of variables names to be saved.

func JsonWrite

func JsonWrite(filename string, interf interface{}) (err error)

JsonWrite: datas to file from given interface / structure i.e: err := WriteJson(filename, &person) remember to put upper char at left of variables names to be saved.

func LinesToTextFile

func LinesToTextFile(filename string, values interface{}) error

Write slice to file

func Lorem

func Lorem(wordCount ...int) string

Generate Lorem Ipsum text

func LoremGenerateTextFile

func LoremGenerateTextFile(filename string, maxWords, maxChars int) error

Generate Lorem Ipsum texte file

func LowercaseAtFirst

func LowercaseAtFirst(inString string) bool

LowercaseAtFirst: true if 1st char is lowercase

func Md5String

func Md5String(inString string) string

Get MD5 checksum from string.

func Md5Sum

func Md5Sum(filename string) string

Get MD5 checksum from file.

func NewDateFormat

func NewDateFormat() []string

func Preppend

func Preppend(slice []string, prepend ...string) []string

Preppend: Add data at the begining of a string slice

func ReadCsv

func ReadCsv(filename, comma string, fields, startLine int, endLine ...int) (records [][]string, err error)

Read data from CSV file

func ReadFile

func ReadFile(filename string) (data []byte, err error)

ReadFile:

func RecurseScanSymlink(path, linkEndPoint string) (fileList []string, err error)

Scan dir and subdir to get symlinks with specified endpoint.

func RemoveDupSl

func RemoveDupSl(slice []string) []string

RemoveDupSl: Remove duplicate entry in a string slice TODO rewrite this function using "reflect.DeepEqual"... on next use

func RemoveDupSl2d

func RemoveDupSl2d(slice [][]string, col int) (outSlice [][]string)

RemoveDupSl2d: Remove duplicate entry in a 2d string slice based on column number content. TODO rewrite this function using "reflect.DeepEqual"... on next use

func RemoveNonAlNum

func RemoveNonAlNum(inString string) string

RemoveNonAlNum: Remove all non alpha-numeric char

func RemoveNonNum

func RemoveNonNum(inString string) string

RemoveNonNum: Remove all non numeric char

func RemoveSpace

func RemoveSpace(inString string) string

ReplaceSpace: replace all [[:space::]] with underscore "_"

func ReplacePunct

func ReplacePunct(inString string) string

ReplacePunct: replace all [[:punct::]] with underscore "_"

func ReplaceSpace

func ReplaceSpace(inString string) string

ReplaceSpace: replace all [[:space::]] with underscore "_"

func ScanDir

func ScanDir(root string, showDirs ...bool) (files []string, err error)

ScanDir retrieve files in a specific directory

func ScanDirDepth

func ScanDirDepth(root string, depth int, showDirs ...bool) (files []string, err error)

ScanSubDir retrieve files in a specific directory and his sub-directory depending on depth argument. depth = -1 mean infinite.

func ScanFile

func ScanFile(file string) (fi fileInfos)

ScanFile: Scan a file and retreive informations about it stored in a fileInfos structure.

func ScanFiles

func ScanFiles(inFiles []string) (outFiles []fileInfos)

ScanFiles: Scan given files and retreive informations about them stored in a []fileInfos structure.

func ScanSubDir

func ScanSubDir(root string, showDirs ...bool) (files []string, err error)

ScanSubDir retrieve files in a specific directory and his sub-directory. don't follow symlink (walk)

func SearchSl

func SearchSl(find string, table [][]string, caseSensitive, POSIXcharClass, POSIXstrictMode, regex, wholeWord bool) (out [][]string, err error)

SearchSl: Search in 2d string slice. cs=case sensitive, ww=whole word, rx=regex

func SetFileEOL

func SetFileEOL(filename, eol string) error

SetFileEOL: Open file and convert EOL (CR, LF, CRLF) then write it back.

func SetTextEOL

func SetTextEOL(inTextBytes []byte, eol string) (outTextBytes []byte, err error)

SetTextEOL: Get EOL from text bytes and convert it to another EOL (CR, LF, CRLF)

func SliceSortDate

func SliceSortDate(slice [][]string, fmtDate string, dateCol, secDateCol int, ascendant bool) [][]string

SliceSortDate: Sort 2d string slice with date inside

func SliceSortFloat

func SliceSortFloat(slice [][]string, col int, ascendant bool, decimalChar string)

SliceSortFloat: Sort 2d string with float value

func SliceSortString

func SliceSortString(slice [][]string, col int, ascendant, caseSensitive, numbered bool)

SliceSortString: Sort 2d string slice

func SplitAtEOL

func SplitAtEOL(data []byte) (outSlice []string)

SplitAtEOL: split data to slice

func SplitNumeric

func SplitNumeric(inString string) (outText []string, err error)

SplitNumeric: Split and keep all numeric values in a string

func StringDecimalSwitchFloat

func StringDecimalSwitchFloat(decimalChar, inString string) float64

Convert comma to dot if needed and return 0 if input string is empty.

func StringToCharacterClasses

func StringToCharacterClasses(inpString string, caseSensitive, strictMode bool) (outString string)

Convert string to character classes equivalent's string

func Tar

func Tar(source, target string) error

Tar: Make standalone tarball

func TempMake

func TempMake(prefix string) string

TempMake: Make temporary directory

func TempRemove

func TempRemove(fName string) (err error)

TempRemove: Remove directory recursively

func TextFileToLines

func TextFileToLines(filename string, opt ...string) (stringsText []string, err error)

Load text file to slice, opt are same as TrimSpace function "-c, -s, +& or -&" and can be cumulative. This function Reconize "CR", "LF", "CRLF", and convert charset to utf-8

func TimeStamp

func TimeStamp() *timeStamp

Get current timestamp

func ToCamel

func ToCamel(inString string, lowerAtFirst ...bool) (outString string)

ToCamel: Turn string into camel case

func TrimSpace

func TrimSpace(inputString string, cmds ...string) (newstring string, err error)

TrimSpace: Some multiple way to trim strings. cmds is optionnal or accept multiples args

func TruncatePath

func TruncatePath(fullpath string, count ...int) (reduced string)

ReducePath: Reduce patch length by preserving count element from the end

func TruncateString

func TruncateString(inString, prefix string, max, option int) string

TruncateString: Reduce string length for display (prefix is separator like: "...", option=0 -> put separator at the begening of output string. Option=1 -> center, is where separation is placed. option=2 -> line feed, trunc the whole string using LF without shorting it. Max, is max char length of the output string.

func UnGzip

func UnGzip(source, target string) error

UnGzip: Unpack

func Untar

func Untar(tarball, target string) error

Untar: extract file from tarball

func UntarGzip

func UntarGzip(sourcefile, dst string, filesList *[]string, removeDir bool) (countedWrittenFiles int, err error)

UntarGzip: unpack tar.gz files list. Return len(filesList)=0 if all files has been restored. removeDir mean that, before restore folder content, the existing dir will be removed.

func UrlsGet

func UrlsGet(inString string) []string

UrlGet: find into sentence the url available part.

func Use

func Use(vals ...interface{})

Use function to avoid "Unused variable ..." msgs

func WordsFrequency

func WordsFrequency(text string) (list [][]string)

WordsFrequency: Counts the frequency with which words appear in a text.

func WriteCsv

func WriteCsv(filename, comma string, rows [][]string) error

Write data to CSV file

func WriteFile

func WriteFile(filename string, datas []byte, doBackup ...bool) (err error)

writeFile: with file backup capability

func WriteTextFile

func WriteTextFile(filename, data string, appendIfExist ...bool) error

Write string to file low lvl format

func Zip

func Zip(source, target string) error

Zip: source directory, target zip file

Types

type Bench

type Bench struct {
	Results []string
	Average string
	Display bool
	// contains filtered or unexported fields
}

Measuring lapse (may be multiples) between operations

func (*Bench) Lapse

func (b *Bench) Lapse(label ...string)

func (*Bench) Stop

func (b *Bench) Stop()

type CharsetList

type CharsetList struct {
	SimpleCharsetList []string
	FullCharsetList   []string
}

func NewCharsetList

func NewCharsetList() CharsetList

func (*CharsetList) GetCharset

func (cl *CharsetList) GetCharset(pos int) (chLong, chShort string)

func (*CharsetList) GetPos

func (cl *CharsetList) GetPos(ch string) (posLong, posShort int)

func (*CharsetList) Init

func (cl *CharsetList) Init()

type DateEntry

type DateEntry struct {
	InPos  int
	OutPos int
	Val    int
	Str    string
}

type Filepath

type Filepath struct {
	Absolute             string
	Relative             string
	Path                 string
	Base                 string
	BaseNoExt            string
	Ext                  string
	ExecFullName         string
	RealPath             string
	RealName             string
	OutputNewExt         string
	OutputAppendFilename string
	OsSeparator          string
	IsDir                bool
	SymLink              bool
	SymLinkTo            string
}

File struct (SplitFilePath)

func SplitFilepath

func SplitFilepath(filename string, newExt ...string) Filepath

Split full filename into path, ext, name, ... optionally add suffix before original extension or change extension Relative: SplitFilepath("wanted relative path", fullpath).Relative Absolute: SplitFilepath("relative path", fullpath).Absolute

type Find_s

type Find_s struct {
	TextBytes       []byte
	FileName        string
	LineEnd         string
	ToSearch        string
	ReplaceWith     string
	CaseSensitive   bool
	UseEscapeChar   bool
	POSIXcharClass  bool
	POSIXstrictMode bool
	Regex           bool
	Wildcard        bool
	WholeWord       bool
	DoReplace       bool
	Positions       Pos_s
}

func SearchAndReplaceInMultipleFiles

func SearchAndReplaceInMultipleFiles(filenames []string, toSearch, replaceWith string,
	caseSensitive, POSIXcharClass, POSIXstrictMode, regex, wildcard, useEscapeChar, wholeWord,
	doReplace, doSave, doBackup, acceptBinary, removeEmptyResult bool) (founds []Find_s, err error)

Search in multiples text files , using "the Find_s struct" to fill needed informations about search preferences. return a slice type []Find_s that contain all informations about found patterns. Output can be saved with backup option.

func (*Find_s) SearchAndReplace

func (s *Find_s) SearchAndReplace() (err error)

Search in plain text, use "the Find_s struct" to fill needed informations about search preferences. return a structure type Find_s that contain all informations about found patterns in the text

type GoDeclarations

type GoDeclarations struct {
	Filename string

	PackageName    string
	Functions      []storeDecl
	FunctNoComment []storeDecl
	FullFunc       []storeDecl
	Types          []storeDecl
	TypesNoComment []storeDecl
	Imports        []storeDecl
	FoundRows      []storeDecl
	// contains filtered or unexported fields
}

func (*GoDeclarations) GoSourceGetInfos

func (d *GoDeclarations) GoSourceGetInfos(filename string, funcName ...string) (err error)

getPackageName: retrieve package name of Go source file

func (*GoDeclarations) GoSourceGetLines

func (d *GoDeclarations) GoSourceGetLines(filename string, wholeWord bool, terms ...string) (exist bool, err error)

getPackageName: retrieve package name of Go source file

type Pos_s

type Pos_s struct {
	Line     []int
	AllLines []int
	WordsPos [][]int
}

type Process

type Process interface {
	// Pid is the process ID for this process.
	Pid() int

	// PPid is the parent process ID for this process.
	PPid() int

	// Executable name running this process. This is not a path to the
	// executable.
	Executable() string
}

Process is the generic interface that is implemented on every platform and provides common operations for processes.

func FindProcess

func FindProcess(pid int) (Process, error)

FindProcess looks up a single process by pid.

Process will be nil and error will be nil if a matching process is not found.

func Processes

func Processes() ([]Process, error)

Processes returns all processes.

This of course will be a point-in-time snapshot of when this method was called. Some operating systems don't provide snapshot capability of the process table, in which case the process table returned might contain ephemeral entities that happened to be running when this was called.

type RowStore

type RowStore struct {
	Idx int
	Cnt int
	Tot int
	Str string
}

func AppendIfMissing

func AppendIfMissing(inputSlice []RowStore, input RowStore) []RowStore

Append to slice if not already exist (RowStore version)

func AppendIfMissingC

func AppendIfMissingC(inputSlice []RowStore, input RowStore) []RowStore

Append to slice if RowStore.cnt value does not already exist (Quote version)

func FindCountStr

func FindCountStr(str, regExpression string) []RowStore

Get count of non alphanum chars in a string in struct(RowStore) format

func FindQuote

func FindQuote(str string, sep string) []RowStore

Get Quote char

type Search struct {
	BrowsedFiles int

	Ready bool

	SearchTime      searchTime
	ShowDir         bool
	CaseSensitive   bool
	POSIXcharClass  bool
	POSIXstrictMode bool
	Regex           bool
	UseEscapeChar   bool
	Wildcard        bool
	WholeWord       bool
	Type            searchType
	// contains filtered or unexported fields
}

func SearchNew

func SearchNew() *Search

func (*Search) Find

func (toFind *Search) Find(root string) (files []string, err error)

Find: Search for file in dir all subdir. Equal performances between this one and the (Depth) version This function get parameter from a Search structure which contain all search options.

func (*Search) FindDepth

func (toFind *Search) FindDepth(root string, depth int) (files []string, err error)

FindDepth: Search for file in dir and subdir depending on depth argument. depth = -1 mean infinite. This function get parameter from a Search structure which contain all search options.

func (*Search) FindDepthTest

func (toFind *Search) FindDepthTest(root string, depth int) (files []string, err error)

FindDepth: Search for file in dir and subdir depending on depth argument. depth = -1 mean infinite. This function get parameter from a Search structure which contain all search options.

func (*Search) SearchAdd

func (s *Search) SearchAdd(searchFor, wWord, logicalOp string)

SearchAdd: Adding entry to be searched. Format: "wordToFind", "w", "&" "w", "", mean WholeWord or no. "&", "|", "!", mean and, or, not

func (*Search) SearchCompile

func (s *Search) SearchCompile()

SearchCompile: create regex string and compile it..

func (*Search) SearchInAdd

func (s *Search) SearchInAdd(searchIn string)

type StringWriter

type StringWriter struct {
	io.Writer
	// contains filtered or unexported fields
}

func (*StringWriter) Write

func (w *StringWriter) Write(p []byte) (n int, err error)

type UnixProcess

type UnixProcess struct {
	// contains filtered or unexported fields
}

UnixProcess is an implementation of Process that contains Unix-specific fields and information.

func (*UnixProcess) Executable

func (p *UnixProcess) Executable() string

func (*UnixProcess) PPid

func (p *UnixProcess) PPid() int

func (*UnixProcess) Pid

func (p *UnixProcess) Pid() int

func (*UnixProcess) Refresh

func (p *UnixProcess) Refresh() error

Refresh reloads all the data associated with this process.

type VarFile

type VarFile struct {
	VarName  string
	Filename string
}

type WordWithDigit

type WordWithDigit struct {
	ForceRightDigit bool
	// contains filtered or unexported fields
}

func (*WordWithDigit) FillWordToMatchMaxLength

func (w *WordWithDigit) FillWordToMatchMaxLength(inString string, removeExt ...bool) (outString string)

FillWordToMatchMaxLength: Convert word(s) into numbered one, like "label1" -> "label000001" etc... results are based on list of words that determine max length of them to determinate the final length of the modified word. This is used in case of sorting list of words that contains numeric value to avoid the disorder result like "1label", "10label", "2label" etc ...

func (*WordWithDigit) Init

func (w *WordWithDigit) Init(words []string)

Jump to

Keyboard shortcuts

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