utils

package
v0.0.0-...-11d5444 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clamp

func Clamp(val, min, max int64) int64

Clamp ensure the value is within a range

func DoCastF64

func DoCastF64(v any) float64

func DoCastStr

func DoCastStr(v any) string

func DoParseI64

func DoParseI64(v string) (out int64)

func FI64

func FI64[T Ints](v T) string

FI64 formats any int types to string

func GetNbr

func GetNbr(doc *goquery.Document, name string) int64

func GetNbrShips

func GetNbrShips(doc *goquery.Document, name string) int64

func I64Ptr

func I64Ptr(v int64) *int64

I64Ptr returns a pointer to int64

func MaxInt

func MaxInt(vals ...int64) int64

MaxInt returns the minimum int64 value

func MinInt

func MinInt(vals ...int64) int64

MinInt returns the minimum int64 value

func ParseI64

func ParseI64(v string) (out int64, err error)

func ParseInt

func ParseInt(val string) int64

ParseInt ...

func ReadBody

func ReadBody(resp *http.Response) (respContent []byte, err error)

func ToInt

func ToInt(buf []byte) (n int)

Types

type Ints

type Ints interface {
	~int64 | ~int
}

Jump to

Keyboard shortcuts

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