Documentation ¶
Overview ¶
Package util provides utility functions. Data size related functions.
Package util provides utility functions. Config related utils.
Package util provides utility functions. Slices related utils.
Package util provides utility functions. Testing related.
Package util provides utility functions. Time and duration processing.
Index ¶
- Constants
- func DurationToString(value time.Duration) string
- func FormatTime(t time.Time) string
- func GetAPIPath() (string, error)
- func GetBinRootPath() (string, error)
- func GetCloneName(port uint) string
- func GetCloneNameStr(port string) string
- func GetConfigPath(name string) (string, error)
- func GetDataFreshness(dataStateAt string) *float64
- func GetMetaPath(name string) (string, error)
- func GetStandardConfigPath(name string) (string, error)
- func GetSwaggerUIPath() (string, error)
- func HashID(id string) string
- func MillisecondsToString(value float64) string
- func ParseBytes(str string) (uint64, error)
- func ParseCustomTime(str string) (time.Time, error)
- func ParseUnixTime(str string) (time.Time, error)
- func SecondsAgo(ts time.Time) uint
- func Unique(list []string) []string
Constants ¶
const ( // NanosecondsInMillisecond defines a number of nanoseconds in an one millisecond. NanosecondsInMillisecond = 1000000.0 // MillisecondsInSecond defines a number of milliseconds in an one second. MillisecondsInSecond = 1000.0 // MillisecondsInMinute defines a number of milliseconds in an one minute. MillisecondsInMinute = 60000.0 // DataStateAtFormat defines the format of a data state timestamp. DataStateAtFormat = "20060102150405" )
const (
// ClonePrefix defines a Database Lab clone prefix.
ClonePrefix = "dblab_clone_"
)
Variables ¶
This section is empty.
Functions ¶
func DurationToString ¶
DurationToString returns human-readable duration with dimensions.
func FormatTime ¶
FormatTime returns string representing time in UTC in defined format.
func GetBinRootPath ¶
GetBinRootPath return path to root directory of the current binary module.
func GetCloneNameStr ¶
GetCloneNameStr returns a clone name.
func GetConfigPath ¶
GetConfigPath return path to configuration file.
func GetDataFreshness ¶
GetDataFreshness returns the time elapsed since the specified date.
func GetMetaPath ¶
GetMetaPath return path to metadata directory.
func GetStandardConfigPath ¶
GetStandardConfigPath return path to file in the directory of standard configs.
func GetSwaggerUIPath ¶
GetSwaggerUIPath return swagger UI path.
func MillisecondsToString ¶
MillisecondsToString return human-readable duration with dimensions.
func ParseBytes ¶
ParseBytes returns number of bytes from string.
func ParseCustomTime ¶
ParseCustomTime returns time parsed from string in defined format.
func ParseUnixTime ¶
ParseUnixTime returns time parsed from unix timestamp integer.
func SecondsAgo ¶
SecondsAgo returns a number of seconds elapsed from the current time.
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Package engine contains tools.
|
Package engine contains tools. |
Package networks describes custom network elements.
|
Package networks describes custom network elements. |
Package pglog provides helpers for a Postgres logs processing.
|
Package pglog provides helpers for a Postgres logs processing. |