tools

package
v0.0.0-...-bc1b0c2 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// B byte
	B uint64 = 1
	// K kilobyte
	K uint64 = 1 << (10 * iota)
	// M megabyte
	M
	// G gigabyte
	G
	// T TeraByte
	T
	// P PetaByte
	P
	// E ExaByte
	E
)

Variables

This section is empty.

Functions

func ByteToInt8

func ByteToInt8(s []byte) []int8

ByteToInt8 convert []byte to []int8

func GetLocalIP

func GetLocalIP() string

func Int8ToByte

func Int8ToByte(s []int8) []byte

Int8ToByte convert []int8 to []byte

func ParseLogNum

func ParseLogNum(strVal string) (ret uint64)

ParseLogNum : Parse uint64 from string

func ParseLogSizeMb

func ParseLogSizeMb(oriSize string) (ret uint64)

ParseLogSizeMb : Translate x(B),xKB,xMB... to uint64 x(MB)

func ParseStrBool

func ParseStrBool(delay string) (ret bool)

ParseStrBool : Parse bool from string

func ParseTimeOut

func ParseTimeOut(timeout int) (ret time.Duration)

ParseTimeOut : Parse time.Duration from int

func UniqueInts

func UniqueInts(a []int) (b []int)

UniqueInts Return unique element list of list a

func UpperBound

func UpperBound(sortedArray []int, in int) (index int)

UpperBound Return the upperbound index for in

Types

This section is empty.

Jump to

Keyboard shortcuts

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