utils

package
v0.0.0-...-d64b273 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DerefAny

func DerefAny(v any) any

func Filter

func Filter[T any](ss []T, test func(T) bool) (ret []T)

func IsRawMessageApiResp

func IsRawMessageApiResp(resp []byte) bool

func MustAtob

func MustAtob(s string) bool

func MustAtof

func MustAtof(s string) float64

func MustAtoi

func MustAtoi(s string) int64

func MustAtoui

func MustAtoui(s string) uint64

func TimedAction

func TimedAction(f func(), onEnd func(t time.Duration))

func TimedFunc

func TimedFunc[T any](f func() T, onEnd func(t time.Duration)) T

func WalkStructLeafWithTag

func WalkStructLeafWithTag(v any, f func(value reflect.Value, tagPath []reflect.StructTag) error) error

Types

type Set

type Set[T comparable] map[T]Void

func NewSet

func NewSet[T comparable]() Set[T]

func NewSetFrom

func NewSetFrom[T comparable](items ...T) Set[T]

func (Set[T]) Add

func (s Set[T]) Add(item T)

func (Set[T]) Clear

func (s Set[T]) Clear()

func (Set[T]) Contains

func (s Set[T]) Contains(item T) bool

func (Set[T]) Len

func (s Set[T]) Len() int

func (Set[T]) Remove

func (s Set[T]) Remove(item T)

func (Set[T]) ToSlice

func (s Set[T]) ToSlice() []T

type Void

type Void struct{}

Jump to

Keyboard shortcuts

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