utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const REQ_TIMEOUT = 6 * time.Second

Variables

This section is empty.

Functions

func AsBool

func AsBool(v string) bool

func CalcArea

func CalcArea(X, Z []float64, numPoints uint16, divisor float64) uint

func CleanString

func CleanString(str string) string

func Euclidean

func Euclidean(x1, z1, x2, z2 float64) float64

func FloatsToInts

func FloatsToInts(arr []float64) []int

func FormatTimestamp

func FormatTimestamp(unixTs float64) string

func GetExisting

func GetExisting[T EntityAccess](a1 []T, a2 []string) any

func GetFieldValue

func GetFieldValue(item interface{}, key string) string

func HexToInt

func HexToInt(hex string) int

func Hypot

func Hypot(num, input, radius int) bool

func JsonRequest

func JsonRequest[T interface{}](url string) (T, error)

func Manhattan

func Manhattan(x1, z1, x2, z2 float64) float64

func OAPIJsonRequest

func OAPIJsonRequest[T interface{}](endpoint string, skipCache bool) (T, error)

func OAPIRequest

func OAPIRequest(endpoint string, skipCache bool) ([]byte, error)

func Prettify

func Prettify(i interface{}) string

func RandomString

func RandomString(length int) string

func Range

func Range(args []float64) int

func Request

func Request(url string) ([]byte, error)

Types

type Entity

type Entity struct {
	Name string
}

func (Entity) GetName

func (e Entity) GetName() string

type EntityAccess

type EntityAccess interface {
	GetName() string
}

Jump to

Keyboard shortcuts

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