Versions in this module Expand all Collapse all v0 v0.1.0 Jan 1, 2025 Changes in this version + var URL_RE = regexp.MustCompile(`^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)`) + func AppendToFirst[T any](arr []T, ele T) []T + func Contain[T comparable](slice []T, target T) bool + func DeDup[T comparable, TS ~[]T](input TS) []T + func DeRef2[T any](input *T, err error) (T, error) + func DecodeLength(bytes []byte) (int, int, error) + func EncodeLength(bytes *[]byte, length int) + func FindIndexByValue[T comparable, TS ~[]T](slice TS, predicate T) int + func FindIndex[T any, TS ~[]T](slice TS, predicate func(T) bool) int + func Find[T any, TS ~[]T](slice TS, predicate func(T) bool) (T, bool) + func MakeWebsocketURL(endpoint string) (string, error) + func MapInt[T constraints.Integer, O constraints.Integer, TS ~[]T](input TS) []O + func MapWithError[T any, O any, TS ~[]T](input TS, mapper func(T) (O, error)) ([]O, error) + func Map[T any, O any, TS ~[]T](input TS, mapper func(T) O) []O + func MergeList[T any, TS ~[]T](args ...TS) []T + func PowInt[T uint8 | int8 | uint16 | int16 | uint32 | int32 | uint64 | int64 | int | uint](base T, p int) T + func RemoveEle[T comparable](arr []T, ele func(T) bool) []T + func RemoveIndex[T any](arr []T, index int) []T + func StructToMap(obj any) map[string]any + func SumInt[T uint8 | int8 | uint16 | int16 | uint32 | int32 | uint64 | int64 | int | uint, ...](base []O, callback func(O) T) T + type KVMap struct + func NewKVMap[K comparable, V any]() *KVMap[K, V] + func (m *KVMap[K, V]) Entries() (keys []K, values []V) + func (m *KVMap[K, V]) InsertOrUpdate(key K, value V, update func(*V)) + func (m *KVMap[K, V]) Keys() (out []K) + func (m *KVMap[K, V]) Values() (out []V) + type Set struct + func NewSet[T comparable]() *Set[T] + func (s *Set[T]) Add(value T) + func (s *Set[T]) AddIfNotExists(value T) + func (s *Set[T]) Exists(value T) bool + func (s *Set[T]) Len() int + func (s *Set[T]) List() []T + func (s *Set[T]) Remove(value T)