util

package
v0.0.0-...-10b4495 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCpuClass

func GetCpuClass() int

GetCpuClass ...

func IsValidPort

func IsValidPort(port int) bool

IsValidPort verifies if the port is valid or not.

func LogTag

func LogTag(tag string) string

Builds a tag for the log entries with indentation in order to align the log entries.

func ObtainIpPort

func ObtainIpPort(hostname string) (string, int)

Obtains IP port from a hostname string i.e. 178.673.111.33:9122.

Types

type Enum

type Enum interface {
	// contains filtered or unexported methods
}

Enum is the interface for all the custom enum types.

type RandSafe

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

RandSafe is a version of math/rand that can be used by multiple goroutines safely.

func NewRandSafe

func NewRandSafe(source rand.Source) *RandSafe

NewRandSafe creates a new RandSafe to be used.

func (*RandSafe) ExpFloat64

func (r *RandSafe) ExpFloat64() float64

func (*RandSafe) Float32

func (r *RandSafe) Float32() float32

func (*RandSafe) Float64

func (r *RandSafe) Float64() float64

func (*RandSafe) Int

func (r *RandSafe) Int() int

func (*RandSafe) Int31

func (r *RandSafe) Int31() int32

func (*RandSafe) Int31n

func (r *RandSafe) Int31n(n int32) int32

func (*RandSafe) Int63

func (r *RandSafe) Int63() int64

func (*RandSafe) Int63n

func (r *RandSafe) Int63n(n int64) int64

func (*RandSafe) Intn

func (r *RandSafe) Intn(n int) int

func (*RandSafe) NormFloat64

func (r *RandSafe) NormFloat64() float64

func (*RandSafe) Perm

func (r *RandSafe) Perm(n int) []int

func (*RandSafe) Read

func (r *RandSafe) Read(p []byte) (int, error)

func (*RandSafe) Seed

func (r *RandSafe) Seed(seed int64)

func (*RandSafe) Uint32

func (r *RandSafe) Uint32() uint32

func (*RandSafe) Uint64

func (r *RandSafe) Uint64() uint64

type SourceSafe

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

SourceSafe is a version of math/rand source that can be used by multiple goroutines safely.

func NewSourceSafe

func NewSourceSafe(source rand.Source) *SourceSafe

NewSourceSafe creates a new SourceSafe to be used.

func (*SourceSafe) Int63

func (s *SourceSafe) Int63() int64

func (*SourceSafe) Seed

func (s *SourceSafe) Seed(seed int64)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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