modulepackage
0.0.0-20220822083226-7f81a180ff49
Repository: https://github.com/hoveychen/go-utils.git
Documentation: pkg.go.dev
# README
go-utils
Golang utility library
# Packages
Package beanstalkd is a higher level wrapper to utilize beanstalkd as a simple message queue.
Package cache provides MemCache as a TTL based simple cache in memory.
Package csv provides CsvReader and CsvWriter to process csv format file in the struct declaration style.
Package flags provide a global flags cache and extends types of flags.
No description provided by the author
Package mongo provides handful wrapper to access and/or modify the mongo database.
Package presto provides struct declaration style wrapper to access presto result.
This package provide a simple way to sample steam data.
Package sort provides ranking method to easily sort a slice.
# Functions
Check provide a quick way to check unexpected errors that should never happen.
CompileRegexp is the same as regexp.Compile(), except it cached all the compiled patterns for performance.
CronTick returns a channel which trigger every *interval* time.
Check provide a quick way to check unexpected errors that should never happen.
No description provided by the author
FetchData is a helper function to load local/remote data in the same function.
No description provided by the author
FetchJson is a wrapper to call FetchData() and parse results from json.
No description provided by the author
FetchXml is a wrapper to call FetchData() and parse results from xml.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
GetFuncName provides shortcut to print the name of any function.
No description provided by the author
No description provided by the author
Init need to be execute in the beginning of main() to get PkgInit() to work.
IsDebuging returns whether it's in debug mode.
No description provided by the author
Jsonify provides shortcut to return an json format string of any varible.
LogDebug prints info to standard output with [DEBUG] prefix in debug mode.
Same as LogDebug, except accepting formating info.
LogError prints error to error output with [ERROR] prefix.
No description provided by the author
Same as LogError, except accepting formating info.
LogFatal prints error to error output with [FATAL] prefix, and terminate the application.
Same as LogFatal, except accepting formating info.
LogInfo prints info to standard output with [INFO] prefix.
Same as LogInfo, except accepting formating info.
MatchString is the same as regexp.MatchString(), except it use the cached version of compiled pattern.
NewError returns an error composed like fmt.Sprintf().
No description provided by the author
No description provided by the author
No description provided by the author
PkgInit is a deferred helper to initialize the package enviornment varible AFTER flags are set.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
PrintJson outputs any varible in Json format to console.
No description provided by the author
No description provided by the author
No description provided by the author
StringSliceContains determines whether a string is contained in another slice.
No description provided by the author
ToTitle converts the first letter of every term in a sentence upper case.
# Variables
In case the deploying machine is not in +8 Timezone.
# Structs
Monitor is a polling helper to get new updates from external source, by comparing the last modified field.
No description provided by the author
No description provided by the author