utilfuncs

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Anyify

func Anyify[T any](items []T) []any

func ArrayIntToArryString

func ArrayIntToArryString(strings []int) []string

func ArrayWithValue

func ArrayWithValue(size int, s string) []string

func DaySeconds

func DaySeconds(t *time.Time) uint

func DayYYYYMMDD

func DayYYYYMMDD(t *time.Time) uint

func DistHaversine

func DistHaversine(a, b Coord) float64

func DurationFormatSecs

func DurationFormatSecs(seconds uint) string

func FilterMapByKeys

func FilterMapByKeys[TK comparable, TV any](m map[TK]TV, validKeys []TK) map[TK]TV

func Flatten

func Flatten[T any](arrArrs [][]T) []T

func IntArrayToStringArray

func IntArrayToStringArray(arrInt []int) []string

func IntArraysSortedFilter

func IntArraysSortedFilter(intArrays [][]int) [][]int

func ItemInArray

func ItemInArray[T comparable](item T, items []T) bool

func MapKeys

func MapKeys[TK comparable, TV any](m map[TK]TV) []TK

func MapValueAdd

func MapValueAdd(m map[string]uint, value uint) map[string]uint

func MaxInt

func MaxInt(a, b uint) uint

func Pairs

func Pairs[T any](items []T) [][]T

func StringInArray

func StringInArray(items []string, findItem string) bool

func TimeHMSFormatSecs

func TimeHMSFormatSecs(seconds uint) string

TODO: is this better to do via time package (AM/PM formatting free then?)

Types

type Coord

type Coord struct {
	Lat float64 `yaml:"lat" json:"lat"`
	Lon float64 `yaml:"lon" json:"lon"`
}

Jump to

Keyboard shortcuts

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