utils

package
v3.0.6+incompatible Latest Latest
Warning

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

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

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