Documentation ¶
Index ¶
- Constants
- Variables
- func AddNumericSuffixIfFileExists(filePath string) string
- func AllFalse(bools ...bool) bool
- func AllTrue(bools ...bool) bool
- func AnyIsEmptyString(slice ...string) bool
- func Atoi(s string) (int, error)
- func BellSound()
- func Black(s string) string
- func BlackBG(s string) string
- func Blacklist(items []string, blacklist []string) []string
- func BlacklistGlob(items []string, blacklist []string) []string
- func Bold(message string) string
- func CLIAskPassword() ([]byte, error)
- func CLIAskString() (string, error)
- func CLIAskYesNo(message string) (bool, error)
- func CLIMustConfirmYes(message string)
- func Change(before int64, after int64) float64
- func CloneSlice(sl []string) []string
- func Colorize(str string) string
- func ColorizeBG(str string) string
- func CombineErrors(errs ...error) error
- func ConcatBytesFromStrings(strs ...string) ([]byte, error)
- func ConstantLength(s string) string
- func CountLines(r io.Reader) (int, error)
- func Countdown(ticker Ticker, duration time.Duration) chan time.Duration
- func CreateFolderIfNotExists(name string, perm os.FileMode) error
- func CryptoRandomIntRange(min, max int) int
- func CustomConstantLength(ln int, s string) string
- func Debugf(format string, a ...interface{})
- func DebugfWithParameters(params []LogHeaderParameter, format string, a ...interface{})
- func DebuglnWithParameters(params []LogHeaderParameter, a ...interface{})
- func Deduplicate(a []string) []string
- func DeduplicateInts(a []int) []int
- func DefaultNotify(handler func(os.Signal) bool)
- func DeterministicRandomIntRange(min, max int) int
- func DirExists(path string) (bool, error)
- func Dump(a ...interface{})
- func Errorf(format string, a ...interface{})
- func Errorln(a ...interface{}) (n int, err error)
- func Fatalf(format string, a ...interface{})
- func Fataln(a ...interface{})
- func FileExists(filepath string) (bool, error)
- func FileExistsWithStat(filepath string) (os.FileInfo, bool, error)
- func FilterExclude(ss []string, filter func(s string) bool) []string
- func FilterModify(ss []string, filter func(s string) string) []string
- func FormatByteSlice(buf []byte) string
- func FormatErrorArray(prefix string, errs []error) string
- func GenerateIntRangeInclusive(from, to int) []int
- func GetAddedRemoved(previous []string, next []string) (added []string, removed []string)
- func GetBaseDomain(name string) (string, string)
- func GetCallerLocation(callDepth int) (string, int)
- func GetDomainExtension(name string) string
- func GetFormattedPercent(done int64, all int64) string
- func GetPercent(done int64, all int64) float64
- func GoFuncErrChan(f func() error) chan error
- func HardWaitSystemSignal(callback func(), messages ...string)
- func HasAnySuffix(s string, suffixes ...string) bool
- func HasAnySuffixDottedOrNot(s string, suffixes ...string) bool
- func HasMatch(item string, patterns []string) (string, bool)
- func HashAnyWithJSON(v interface{}) (uint64, error)
- func HashBytes(b []byte) uint64
- func HashString(s string) uint64
- func HighlightAnyCase(str, substr string, colorer func(string) string) string
- func HighlightLimeBG(str, substr string) string
- func HighlightRedBG(str, substr string) string
- func IndentWithSpaces(n int, s string) string
- func IndentWithTabs(n int, s string) string
- func Indigo(s string) string
- func IndigoBG(s string) string
- func Infof(format string, a ...interface{})
- func InitDomainExtensions(path string)
- func IntSliceContains(slice []int, element int) bool
- func IsAnyOf(s string, candidates ...string) bool
- func IsByteSlice(v interface{}) bool
- func IsFolder(path string) (bool, error)
- func IsLastUnicode(s string) bool
- func IsLight(rr, gg, bb uint64) bool
- func IsNotAnyOf(s string, candidates ...string) bool
- func IterateStringAsRunes(s string, callback func(r rune) bool)
- func Itoa(i int) string
- func KitchenTimeMsNow() string
- func KitchenTimeNow() string
- func Lime(str string) string
- func LimeBG(str string) string
- func ListChildDirs(path string) ([]string, error)
- func ListChildDirsWithBlacklist(path string, blacklistPatterns []string) ([]string, error)
- func ListChildDirsWithWhitelist(path string, whitelistPatterns []string) ([]string, error)
- func ListFiles(path string) ([]string, error)
- func Ln(a ...interface{})
- func LoadJSON(ptr interface{}, filepath string) error
- func LoadYaml(ptr interface{}, filepath string) error
- func LogElapsedFromLastLogMessage() string
- func LogElapsedFromStart() string
- func LogMessageNumber() string
- func LogParamCallStack() string
- func LogParamTimestamp() string
- func LogParamTimestampMs() string
- func LogRunID() string
- func MoreThanOneIsTrue(bools ...bool) bool
- func MustAbs(path string) string
- func MustAtoi(s string) int
- func MustCopyFile(src, dst string)
- func MustCreateFolderIfNotExists(path string, perm os.FileMode)
- func MustFileExists(path string) bool
- func MustGetenv(key string) string
- func MustHashAnyWithJSON(v interface{}) uint64
- func MustLoadJSON(ptr interface{}, filepath string)
- func MustParseUnicode(code string) string
- func MustParseUnicodeAsRune(code string) rune
- func MustRemoveFile(path string)
- func MustSaveAsIndentedJSON(v interface{}, filepath string)
- func MustSaveAsJSON(v interface{}, filepath string)
- func NewHTMLTemplateFromFile(path string) (*htmltemplate.Template, error)
- func NewHTMLTemplateFromFileWithFuncs(path string, funcs htmltemplate.FuncMap) (*htmltemplate.Template, error)
- func NewSectionReader(file *os.File) *io.SectionReader
- func NewSpacesIndenter(spaceWidth int) func(n int, s string) string
- func NewTextTemplateFromFile(path string) (*texttemplate.Template, error)
- func NewTextTemplateFromFileWithFuncs(path string, funcs texttemplate.FuncMap) (*texttemplate.Template, error)
- func NewTextTemplateFromString(name string, tpl string) (*texttemplate.Template, error)
- func NewTicker(duration time.Duration) <-chan time.Time
- func NewTimer() func() time.Duration
- func NewTimerRaw() func() time.Duration
- func NewUniqueElements(orig []string, add ...string) []string
- func NewUniqueInts(orig []int, add ...int) []int
- func Notify(handler OsSignalHandler, signals ...os.Signal)
- func Orange(message string) string
- func OrangeBG(message string) string
- func PanicIfAlreadyExists(path string)
- func ParseIntervals(s string) ([]int, error)
- func ParseUnicode(code string) (rune, error)
- func Percent(pcent int64, all int64) float64
- func PercentOf(current int64, all int64) float64
- func Purple(s string) string
- func PurpleBG(s string) string
- func Q(v ...interface{})
- func Qs(v ...interface{})
- func RandomIntRange(min, max int) int
- func RandomString(n int) string
- func ReadConfigLinesAsString(filepath string, iterator func(line string) bool) error
- func ReadFileLinesAsString(filepath string, iterator func(line string) bool) error
- func ReadStringLineByLine(s string, iterator func(line string) bool) error
- func Red(str string) string
- func RedBG(s string) string
- func RepeatString(n int, char string) string
- func RetryExponentialBackoff(attempts int, initialSleep time.Duration, task func() error) []error
- func RetryLinearBackoff(attempts int, sleep time.Duration, task func() error) []error
- func ReturnNSpaces(n int) string
- func ReverseDNSLabels(hostname string) string
- func ReverseIntSlice(ss []int)
- func ReverseString(s string) string
- func ReverseStringSlice(ss []string)
- func RunBatch(fn ...RunBatchFunc) error
- func SanitizeFileNamePart(part string) string
- func SaveAsIndentedJSON(v interface{}, filepath string) error
- func SaveAsJSON(v interface{}, filepath string) error
- func SaveAsYaml(v interface{}, filepath string) error
- func Sdump(a ...interface{}) string
- func Sf(format string, a ...interface{}) string
- func Sfln(format string, a ...interface{})
- func Shakespeare(str string) string
- func ShakespeareBG(str string) string
- func ShuffleCryptoRand(n int, swap func(i, j int))
- func ShuffleIntSliceCryptoRand(a []int)
- func ShuffleIntSliceMathRand(a []int)
- func ShuffleMathRand(n int, swap func(i, j int))
- func SizeOfFile(file *os.File) int64
- func SliceContains(slice []string, element string) bool
- func SplitStringByRune(s string) []rune
- func SplitStringByRuneAsStringSlice(s string) []string
- func SplitStringSlice(parts int, slice []string) [][]string
- func Sq(v ...interface{}) string
- func StringToColor(str string) func(string) string
- func StringToColorBG(str string) func(string) string
- func Successf(format string, a ...interface{})
- func ThisFuncName() string
- func ToCamel(s string) string
- func ToCamelWithAcronyms(s string, acronyms map[string]bool) string
- func ToDelimited(s string, delimiter uint8) string
- func ToKebab(s string) string
- func ToLower(s string) string
- func ToLowerCamel(s string) string
- func ToLowerCamelWithAcronyms(s string, acronyms map[string]bool) string
- func ToScreamingDelimited(s string, delimiter uint8, ignore uint8, screaming bool) string
- func ToScreamingKebab(s string) string
- func ToScreamingSnake(s string) string
- func ToSnake(s string) string
- func ToSnakeWithIgnore(s string, ignore uint8) string
- func ToStringKeyVals(keyvals ...string) (keys []string, vals []string)
- func ToTitle(s string) string
- func TranscodeJSON(input interface{}, destinationPointer interface{}) error
- func TranscodeYAML(input interface{}, destinationPointer interface{}) error
- func TrimDNSLabelFromBeginning(name string) (string, string)
- func TrimExt(p string) string
- func TrimFrom(s string, after string) string
- func UniqueAppend(orig []string, add ...string) []string
- func UniqueAppendInts(orig []int, add ...int) []int
- func WaitHasTimedout(wg *sync.WaitGroup, timeout time.Duration) (timedout bool)
- func WaitSystemSignal(messages ...string)
- func Warnf(format string, a ...interface{})
- func White(s string) string
- func WhiteBG(s string) string
- func WhitelistGlob(items []string, whitelist []string) []string
- func Yellow(message string) string
- func YellowBG(message string) string
- type CombinedErrors
- type ElasticStringIterator
- type ExitLight
- type FlagStringArray
- type LogHeaderParameter
- type OsSignalHandler
- type Replacer
- type RunBatchFunc
- type SizedGroup
- type TickFunc
- type Ticker
- type WriteByWrite
Constants ¶
const ( Checkmark = "✓" XMark = "✗" )
TODO: number to color TODO: string to color TODO: short readable hash
const (
FilenameTimeFormat = "Mon02Jan2006_15.04.05"
)
Variables ¶
var ( DebugPrefix string = "[DEBU]" InfoPrefix string = "[INFO]" SuccessPrefix string = Lime("[SUCC]") WarnPrefix string = Yellow("[WARN]") ErrorPrefix string = RedBG("[ERRO]") FatalPrefix string = RedBG("[FATAL]") )
var ConstantPredeterminedLength = 60
var DefaultLogParameters = []LogHeaderParameter{ LogMessageNumber, LogParamTimestamp, LogElapsedFromStart, }
var ErrNotDir = errors.New("path is not a directory")
var (
LogIncludeLevel bool = true
)
Functions ¶
func AddNumericSuffixIfFileExists ¶
AddNumericSuffixIfFileExists: if the specified file exists, a numeric suffix is added to the name of the file, right before the extension; numeric suffixes are tried incrementally until a non-existing file is idedntified; the complete filepath is returned (no file is created at this stage).
func AnyIsEmptyString ¶
func Blacklist ¶
Blacklist filters out elements from the `items` slice that are also present in the `blacklist` slice; a simple == comparison is done.
func BlacklistGlob ¶
BlacklistGlob filters out elements from the `items` slice that match any pattern from the `blacklist` slice; a glob comparison is done.
func CLIAskPassword ¶
CLIAskPassword prompts the user for a password input fro the CLI
func CLIAskString ¶
CLIAskString prompts the user for a string input from the CLI
func CLIAskYesNo ¶
CLIAskYesNo parses an input from the terminal and returns whether the response is affirmative or negative.
func CLIMustConfirmYes ¶
func CLIMustConfirmYes(message string)
func Change ¶
Change calculate what is the percentage increase/decrease from [number1] to [number2] For example 60 is 200% increase from 20 It returns result as float64
func CloneSlice ¶
func ColorizeBG ¶
func CombineErrors ¶
func ConcatBytesFromStrings ¶
ConcatBytesFromStrings concatenates multiple strings into one array of bytes
func ConstantLength ¶
func CreateFolderIfNotExists ¶
CreateFolderIfNotExists creates a folder if it does not exists
func CryptoRandomIntRange ¶
CryptoRandomIntRange returns a random integer in the given range. Randomness is from "crypto/rand" package.
func CustomConstantLength ¶
func DebugfWithParameters ¶
func DebugfWithParameters(params []LogHeaderParameter, format string, a ...interface{})
func DebuglnWithParameters ¶
func DebuglnWithParameters(params []LogHeaderParameter, a ...interface{})
func Deduplicate ¶
Deduplicate returns a deduplicated copy of a.
func DeduplicateInts ¶
func DefaultNotify ¶
func DeterministicRandomIntRange ¶
RandomIntRange returns a random integer in the given range
func FileExists ¶
func FilterExclude ¶
FilterExclude returns a new array of items that do not match the filter func; for any item in `ss`, if the `filter` func returns true, then the item will be excluded from the result slice.
func FilterModify ¶
FilterModify returns a new array containing the values of `ss` after they have been processed by the func `filter`; no modification to `ss` is done.
func FormatByteSlice ¶
func FormatErrorArray ¶
func GenerateIntRangeInclusive ¶
Generate number range including `from` and `to`.
func GetAddedRemoved ¶
func GetBaseDomain ¶
GetBaseDomain returns the first label after the domain extension, ad the domain extension.
e.g. example.com -> example + .com e.g. subdomain.example.com -> example + .com
e.g. example.co.uk -> example + .co.uk e.g. subdomain.example.co.uk -> example + .co.uk
func GetCallerLocation ¶
GetCallerLocation returns the source location of the call at callDepth stack frames above the call.
func GetDomainExtension ¶
GetDomainExtension returns the domain extension (among the known ones) of the provided host names.
func GetFormattedPercent ¶
func GetPercent ¶
func GoFuncErrChan ¶
func HardWaitSystemSignal ¶
func HardWaitSystemSignal(callback func(), messages ...string)
HardWaitSystemSignal calls the callback at first signal, and waits for the callback to finish; when the callback finishes, HardWaitSystemSignal also finishes. If a second sygnal is sent before the callback finishes, a hard os.Exit is done.
func HasAnySuffix ¶
HasAnySuffix returns true if the string s has any of the prefixes provided.
func HasAnySuffixDottedOrNot ¶
HasAnySuffixDottedOrNot returns true if the string s has any of the suffixes, whether they are in the .<suffix> or <suffix> variant.
func HashAnyWithJSON ¶
func HashString ¶
func HighlightAnyCase ¶
func HighlightLimeBG ¶
func HighlightRedBG ¶
func IndentWithSpaces ¶
func IndentWithTabs ¶
func InitDomainExtensions ¶
func InitDomainExtensions(path string)
func IntSliceContains ¶
IntSliceContains returns true if the provided slice of ints contains the element
func IsByteSlice ¶
func IsByteSlice(v interface{}) bool
func IsLastUnicode ¶
func IsNotAnyOf ¶
func IterateStringAsRunes ¶
func KitchenTimeMsNow ¶
func KitchenTimeMsNow() string
func KitchenTimeNow ¶
func KitchenTimeNow() string
func ListChildDirs ¶
ListChildDirs lists folders (full path) inside the specified folder (just first level; no grandchildren); if the provided filepath is not a folder, and error is returned.
func ListChildDirsWithBlacklist ¶
ListChildDirsWithBlacklist lists the child folders (full path) of a parent folder, filtering out folders that match one of the provided blacklist glob patterns.
func ListChildDirsWithWhitelist ¶
ListChildDirsWithWhitelist lists the child folders (full path) of a parent folder, filtering out folders that DON'T match any of the provided whitelist glob patterns.
func ListFiles ¶
ListFiles lists files (full path) inside the specified folder (just first level; no grandchildren); if the provided filepath is not a folder, and error is returned.
func LogElapsedFromLastLogMessage ¶
func LogElapsedFromLastLogMessage() string
LogElapsedFromLastLogMessage adds to the log header the time passed from the last log call.
func LogElapsedFromStart ¶
func LogElapsedFromStart() string
LogElapsedFromStart adds the time passed from the program start.
func LogMessageNumber ¶
func LogMessageNumber() string
LogMessageNumber adds the index of the log call (incremental) to the log header.
func LogParamCallStack ¶
func LogParamCallStack() string
LogParamCallStack adds the file and line number of the log call to the log message.
func LogParamTimestamp ¶
func LogParamTimestamp() string
LogParamTimestamp adds a timestamp of current time to the log header.
func LogParamTimestampMs ¶
func LogParamTimestampMs() string
LogParamTimestamp adds a timestamp of current time (that inludes milliseconds) to the log header.
func LogRunID ¶
func LogRunID() string
LogRunID adds to the log header the unique ID of this program run.
func MoreThanOneIsTrue ¶
func MustCopyFile ¶
func MustCopyFile(src, dst string)
func MustFileExists ¶
func MustGetenv ¶
func MustHashAnyWithJSON ¶
func MustHashAnyWithJSON(v interface{}) uint64
func MustLoadJSON ¶ added in v0.1.3
func MustLoadJSON(ptr interface{}, filepath string)
func MustParseUnicode ¶
func MustParseUnicodeAsRune ¶
func MustRemoveFile ¶
func MustRemoveFile(path string)
func MustSaveAsIndentedJSON ¶ added in v0.1.3
func MustSaveAsIndentedJSON(v interface{}, filepath string)
func MustSaveAsJSON ¶ added in v0.1.3
func MustSaveAsJSON(v interface{}, filepath string)
func NewHTMLTemplateFromFile ¶
func NewHTMLTemplateFromFile(path string) (*htmltemplate.Template, error)
func NewHTMLTemplateFromFileWithFuncs ¶
func NewHTMLTemplateFromFileWithFuncs(path string, funcs htmltemplate.FuncMap) (*htmltemplate.Template, error)
func NewSectionReader ¶
func NewSectionReader(file *os.File) *io.SectionReader
NewSectionReader creates a SectionReader from the provided file.
func NewTextTemplateFromFile ¶
func NewTextTemplateFromFile(path string) (*texttemplate.Template, error)
func NewTextTemplateFromFileWithFuncs ¶
func NewTextTemplateFromFileWithFuncs(path string, funcs texttemplate.FuncMap) (*texttemplate.Template, error)
func NewTextTemplateFromString ¶
func NewTextTemplateFromString(name string, tpl string) (*texttemplate.Template, error)
func NewTicker ¶
NewTicker returns a time channel that ticks ever specified interval, with the initial tick righ when you start listening.
func NewTimerRaw ¶
func NewUniqueElements ¶
NewUniqueElements removes elements that have duplicates in the original or new elements.
func NewUniqueInts ¶
NewUniqueInts removes elements that have duplicates in the original or new elements.
func Notify ¶
func Notify(handler OsSignalHandler, signals ...os.Signal)
Notify calls handler when gets specified signals and pass given signal to handler. If handler returns false, notify stops waiting for signals.
func PanicIfAlreadyExists ¶
func PanicIfAlreadyExists(path string)
func ParseIntervals ¶
ParseIntervals parses a string representing a list of unsigned integers or integer ranges (using dashes).
func ParseUnicode ¶
func Percent ¶
Percent calculate what is [percent]% of [number] For Example 25% of 200 is 50 It returns result as float64
func PercentOf ¶
PercentOf calculate [number1] is what percent of [number2] For example 300 is 12.5% of 2400 It returns result as float64
func RandomIntRange ¶
RandomIntRange returns a random integer in the given range; Randomness is from "math/rand" package.
func RandomString ¶
RandomString returns a randomly-generated string of length = n
func ReadConfigLinesAsString ¶
ReadConfigLinesAsString iterates on the lines of a text file, trimming spaces, ignoring empty lines and comments.
func ReadFileLinesAsString ¶
ReadFileLinesAsString iterates on the lines of a text file
func ReadStringLineByLine ¶
ReadStringLineByLine iterates over a multiline string
func RepeatString ¶
func RetryExponentialBackoff ¶
RetryExponentialBackoff executes task; if it returns an error, it will retry executing the task the specified number of times before giving up, and at each retry it will sleep double the amout of time of the previous retry; the initial sleep time is specified by the user.
func RetryLinearBackoff ¶
func ReturnNSpaces ¶
func ReverseDNSLabels ¶
ReverseDNSLabels reverses the labels of a DNS, and returns the DNS name.
func ReverseStringSlice ¶
func ReverseStringSlice(ss []string)
ReverseStringSlice reverses a string slice
func RunBatch ¶
func RunBatch(fn ...RunBatchFunc) error
RunBatch runs all functions simultaneously and waits until execution has completed or an error is encountered.
func SanitizeFileNamePart ¶
func SaveAsIndentedJSON ¶
func SaveAsJSON ¶
func SaveAsYaml ¶
func ShakespeareBG ¶
func ShuffleCryptoRand ¶
func ShuffleIntSliceCryptoRand ¶
func ShuffleIntSliceCryptoRand(a []int)
func ShuffleIntSliceMathRand ¶
func ShuffleIntSliceMathRand(a []int)
func ShuffleMathRand ¶
func SliceContains ¶
SliceContains returns true if the provided slice of strings contains the element
func SplitStringByRune ¶
func SplitStringSlice ¶
func StringToColor ¶
func StringToColorBG ¶
func ThisFuncName ¶
func ThisFuncName() string
func ToCamelWithAcronyms ¶ added in v0.1.1
ToCamel converts a string to CamelCase
func ToDelimited ¶
ToDelimited converts a string to delimited.snake.case (in this case `delimiter = '.'`)
func ToLowerCamel ¶
ToLowerCamel converts a string to lowerCamelCase
func ToLowerCamelWithAcronyms ¶ added in v0.1.1
ToLowerCamel converts a string to lowerCamelCase
func ToScreamingDelimited ¶
ToScreamingDelimited converts a string to SCREAMING.DELIMITED.SNAKE.CASE (in this case `delimiter = '.'; screaming = true`) or delimited.snake.case (in this case `delimiter = '.'; screaming = false`)
func ToScreamingKebab ¶
ToScreamingKebab converts a string to SCREAMING-KEBAB-CASE
func ToScreamingSnake ¶
ToScreamingSnake converts a string to SCREAMING_SNAKE_CASE
func ToSnakeWithIgnore ¶
func ToStringKeyVals ¶
func TranscodeJSON ¶
func TranscodeJSON(input interface{}, destinationPointer interface{}) error
TranscodeJSON converts the input to json, and then unmarshals it into the destination. The destination must be a pointer.
func TranscodeYAML ¶
func TranscodeYAML(input interface{}, destinationPointer interface{}) error
TranscodeYAML converts the input to yaml, and then unmarshals it into the destination. The destination must be a pointer.
func TrimDNSLabelFromBeginning ¶
TrimDNSLabelFromBeginning removes one label from the DNS name, and returns the new DNS name and the removed label.
func TrimFrom ¶
TrimFrom removes the string `after` from the string `s` and anything that comes after it.
func UniqueAppend ¶
UniqueAppend behaves like the Go append, but does not add duplicate elements.
func UniqueAppendInts ¶
UniqueAppendInts behaves like the Go append, but does not add duplicate elements.
func WaitHasTimedout ¶
WaitHasTimedout waits for the waitgroup for the specified max timeout. Returns true if waiting timed out.
func WaitSystemSignal ¶
func WaitSystemSignal(messages ...string)
func WhitelistGlob ¶
WhitelistGlob filters out elements from the `items` slice that DON'T match any pattern from the `whitelist` slice; a glob comparison is done.
Types ¶
type CombinedErrors ¶
type CombinedErrors struct {
// contains filtered or unexported fields
}
func (*CombinedErrors) Error ¶
func (ce *CombinedErrors) Error() string
type ElasticStringIterator ¶
type ElasticStringIterator struct {
// contains filtered or unexported fields
}
func NewElasticStringIterator ¶
func NewElasticStringIterator(arr []string) *ElasticStringIterator
type ExitLight ¶ added in v0.1.3
type ExitLight struct {
// contains filtered or unexported fields
}
func NewExitLight ¶ added in v0.1.3
func NewExitLight() *ExitLight
func (*ExitLight) SetAsExiting ¶ added in v0.1.3
func (light *ExitLight) SetAsExiting()
type FlagStringArray ¶
type FlagStringArray []string
func (*FlagStringArray) Set ¶
func (i *FlagStringArray) Set(value string) error
func (*FlagStringArray) String ¶
func (i *FlagStringArray) String() string
type LogHeaderParameter ¶
type LogHeaderParameter func() string
type OsSignalHandler ¶
type Replacer ¶
type Replacer struct {
// contains filtered or unexported fields
}
func NewReplacer ¶
type RunBatchFunc ¶
type RunBatchFunc func() error
RunBatchFunc is the function signature for RunBatch.
type SizedGroup ¶ added in v0.1.3
type SizedGroup struct {
// contains filtered or unexported fields
}
func NewSizedGroup ¶ added in v0.1.3
func NewSizedGroup(cNum int64) *SizedGroup
func SizedGroupWithContext ¶ added in v0.1.3
func SizedGroupWithContext(ctx context.Context) (*SizedGroup, context.Context)
func (*SizedGroup) Go ¶ added in v0.1.3
func (g *SizedGroup) Go(f func() error)
Go calls the given function in a new goroutine.
The first call to return a non-nil error cancels the group; its error will be returned by Wait.
func (*SizedGroup) Wait ¶ added in v0.1.3
func (g *SizedGroup) Wait() error
Wait blocks until all function calls from the Go method have returned, then returns the first non-nil error (if any) from them.
type WriteByWrite ¶
type WriteByWrite struct {
// contains filtered or unexported fields
}
func NewWriteByWrite ¶
func NewWriteByWrite(name string) *WriteByWrite
func (*WriteByWrite) Bytes ¶
func (rec *WriteByWrite) Bytes() []byte
func (WriteByWrite) String ¶
func (rec WriteByWrite) String() string