Documentation ¶
Index ¶
- func AddToSet[T comparable](set []T, add ...T) []T
- func Banish[T any](s []T, i int) []T
- func Diff[T comparable](s1 []T, s2 []T) []T
- func Filter[S ~[]T, T any](ts S, fn func(t T) bool) []T
- func FilterMap[T, V any](ts []T, fn func(T) (V, bool)) []V
- func GlobbyHash(charLimit int, dataToHash ...any) string
- func InsertFunc[S ~[]T, T any](ts S, t T, cmp func(a T, b T) int) S
- func Map[T, V any](ts []T, fn func(T) V) []V
- func MapToKeys[T comparable, V any](tMap map[T]V) []T
- func MapToSliceMutate[T comparable, X, V any](tMap map[T]X, fn func(T, X) V) []V
- func MapToValues[T comparable, V any](tMap map[T]V) []V
- func OnlyUnique[T comparable](s []T) (rs []T)
- func OracleReader(r io.Reader, readerSize int64) ([]byte, error)
- func RecoverPanic(preText string)
- func Reduce[T, A any](ts []T, fn func(T, A) A, acc A) A
- func SliceConvert[V, T any](ts []T) []V
- func Yoink[T any](s []T, i int) ([]T, T)
- func YoinkFunc[T any](s []T, fn func(f T) bool) (rs []T, rt T, re bool)
- type Stopwatch
- type WeblensHash
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddToSet ¶
func AddToSet[T comparable](set []T, add ...T) []T
func Banish ¶
Banish removes the element at index, i, from the slice, s, in place
Banish returns a slice of length len(s) - 1
func Diff ¶
func Diff[T comparable](s1 []T, s2 []T) []T
func GlobbyHash ¶
GlobbyHash Set charLimit to 0 to disable
func InsertFunc ¶
func MapToKeys ¶
func MapToKeys[T comparable, V any](tMap map[T]V) []T
func MapToSliceMutate ¶
func MapToSliceMutate[T comparable, X, V any](tMap map[T]X, fn func(T, X) V) []V
func MapToValues ¶
func MapToValues[T comparable, V any](tMap map[T]V) []V
Takes a generic map and returns a slice of the values
func OnlyUnique ¶
func OnlyUnique[T comparable](s []T) (rs []T)
func OracleReader ¶
OracleReader is almost exactly like io.ReadAll, but if we know how long the content is, we can allocate the whole array up front, saving a bit of time (I hope)
func RecoverPanic ¶
func RecoverPanic(preText string)
func SliceConvert ¶
func SliceConvert[V, T any](ts []T) []V
SliceConvert Perform type assertion on slice
Types ¶
type Stopwatch ¶
type Stopwatch interface { Lap(tag ...any) Stop() time.Duration PrintResults(firstLapIsStart bool) GetTotalTime(firstLapIsStart bool) time.Duration }
func NewStopwatch ¶
type WeblensHash ¶
type WeblensHash struct {
// contains filtered or unexported fields
}
func NewWeblensHash ¶
func NewWeblensHash() *WeblensHash
func (*WeblensHash) Add ¶
func (h *WeblensHash) Add(data []byte) error
func (*WeblensHash) Done ¶
func (h *WeblensHash) Done(len int) string
Click to show internal directories.
Click to hide internal directories.