utils

package
v2.1.6+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2019 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version = "None"
	BuildTS = "None"
	GitHash = "None"
)

Version information.

Functions

func GetCPUPercentage

func GetCPUPercentage() float64

GetCPUPercentage calculates CPU usage and returns percentage in float64(e.g. 2.5 means 2.5%). http://man7.org/linux/man-pages/man2/getrusage.2.html

func GetRawInfo

func GetRawInfo(app string) string

GetRawInfo do what its name tells

func OriginError

func OriginError(err error) error

OriginError return original err

func ParseHostPortAddr

func ParseHostPortAddr(s string) ([]string, error)

ParseHostPortAddr returns a scheme://host:port or host:port list

func SliceToMap

func SliceToMap(slice []string) map[string]interface{}

SliceToMap converts slice to map

func StringsToInterfaces

func StringsToInterfaces(strs []string) []interface{}

StringsToInterfaces converts string slice to interface slice

func TSOToRoughTime

func TSOToRoughTime(ts int64) time.Time

TSOToRoughTime translates tso to rough time that used to display

func ToTLSConfig

func ToTLSConfig(SSLCA, SSLCert, SSLKey string) (*tls.Config, error)

ToTLSConfig generates tls's config.

Types

This section is empty.

Jump to

Keyboard shortcuts

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