utils

package
v0.0.0-...-04a33bb Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnableAllCPU

func EnableAllCPU()

func GbkToUtf8

func GbkToUtf8(str string) string

func GetIPsFromCIDR

func GetIPsFromCIDR(cidr string) ([]string, error)

func GetPercentage

func GetPercentage(v, m, a int) float64

func GetPercentageString

func GetPercentageString(v, m, a int, s bool) string

func GetRandomInt

func GetRandomInt(min, max int) int

func GetRandomIntN

func GetRandomIntN(n int) int

func GetRandomString

func GetRandomString(l int) string

func NewLine

func NewLine() string

func StringIndexOf

func StringIndexOf(src, sub string, i int) int

func TestTCPConnect

func TestTCPConnect(ip string, port, timeout, count int) (min, max, avg, out int)

func TestUDPConnect

func TestUDPConnect(ip string, port, timeout, count int) (min, max, avg, out int)

func UnixTimeByMilliseconds

func UnixTimeByMilliseconds(ms int64) time.Time

func UnixTimeBySeconds

func UnixTimeBySeconds(s int64) time.Time

func Utf8ToGbk

func Utf8ToGbk(str string) string

Types

type Queue

type Queue struct {
	// contains filtered or unexported fields
}

func NewQueue

func NewQueue() *Queue

func (*Queue) Dequeue

func (self *Queue) Dequeue() interface{}

func (*Queue) Empty

func (self *Queue) Empty() bool

func (*Queue) Enqueue

func (self *Queue) Enqueue(value interface{})

func (*Queue) Len

func (self *Queue) Len() int

func (*Queue) Peak

func (self *Queue) Peak() interface{}

type Stack

type Stack struct {
	// contains filtered or unexported fields
}

func NewStack

func NewStack() *Stack

func (*Stack) Empty

func (self *Stack) Empty() bool

func (*Stack) Len

func (self *Stack) Len() int

func (*Stack) Peak

func (self *Stack) Peak() interface{}

func (*Stack) Pop

func (self *Stack) Pop() interface{}

func (*Stack) Push

func (self *Stack) Push(value interface{})

Jump to

Keyboard shortcuts

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