Documentation
¶
Index ¶
- func ArgsToMap(capacity, ratePerSec, tRCap, tRRate, tSCap, tSRate float64, ...) map[string][]byte
- func Byte2String(bs []int8) string
- func CopyMap(from *map[string]string) map[string]string
- func GetLineByKeyword(path string, keyword string) string
- func GetStrByKeyword(path string, keyword string) string
- func GetStrByKeywordFiles(pathes []string, keyword string) (path string, line string)
- func GoVersion() string
- func InstallDir() string
- func InstallTsInSec() int64
- func IsHigherOrEqualGoVersion(version string) bool
- func LastRestartInUSec() int64
- func Max(x, y int) int
- func Min(x, y int) int
- func SPrintBson(message []byte) string
- func Version() string
- type SafeBuffer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArgsToMap ¶ added in v1.1.0
func ArgsToMap(capacity, ratePerSec, tRCap, tRRate, tSCap, tSRate float64, metricsFlushInterval, maxTransactions int, token []byte) map[string][]byte
ArgsToMap uses settings as float/int/bytes to create a map of string keys to bytes, for usability by oboe UpdateSetting.
func Byte2String ¶
Byte2String converts a byte array into a string
func GetLineByKeyword ¶
GetLineByKeyword reads a file, searches for the keyword and returns the matched line. It returns empty string "" if no match found or failed to open the path. Pass an empty string "" if you just need to get the first line.
func GetStrByKeyword ¶
GetStrByKeyword read a file, searches for the keyword and returns the matched line with trailing line-feed character trimmed.
func GetStrByKeywordFiles ¶
GetStrByKeywordFiles does the same thing as GetStrByKeyword but searches for a list of files and returns the first matched files and line
func InstallDir ¶
func InstallDir() string
func InstallTsInSec ¶
func InstallTsInSec() int64
func IsHigherOrEqualGoVersion ¶
IsHigherOrEqualGoVersion checks if go version is higher or equal to the given version
func LastRestartInUSec ¶
func LastRestartInUSec() int64
func SPrintBson ¶
SPrintBson prints the BSON message. It's not concurrent-safe and is for testing only
Types ¶
type SafeBuffer ¶
SafeBuffer is goroutine-safe buffer. It is for internal test use only.
func (*SafeBuffer) Len ¶
func (b *SafeBuffer) Len() int
func (*SafeBuffer) String ¶
func (b *SafeBuffer) String() string