utils

package
v0.7.12 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

type Consumer[T any] func(T)

type ErrorSupplier

type ErrorSupplier[T any] func() (T, error)

type Function

type Function[T any, R any] func(T) R

type Map

type Map[K comparable, T any] struct {
	// contains filtered or unexported fields
}

func FromMap

func FromMap[K comparable, T any](m map[K]T) *Map[K, T]

func NewMap

func NewMap[K comparable, T any]() *Map[K, T]

func (*Map[K, T]) Clear

func (m *Map[K, T]) Clear()

func (*Map[K, T]) Delete

func (m *Map[K, T]) Delete(key K)

func (*Map[K, T]) Find

func (m *Map[K, T]) Find(f func(key K, value T) bool) (*K, *T)

func (*Map[K, T]) ForEach

func (m *Map[K, T]) ForEach(f func(key K, value T))

Do not use this to modify the map

func (*Map[K, T]) ForEachModifySafe

func (m *Map[K, T]) ForEachModifySafe(f func(key K, value T))

Use this if the function modifies the map

func (*Map[K, T]) Get

func (m *Map[K, T]) Get(key K) (T, bool)

func (*Map[K, T]) Len

func (m *Map[K, T]) Len() int

func (*Map[K, T]) Set

func (m *Map[K, T]) Set(key K, value T)

type Supplier

type Supplier[T any] func() T

Jump to

Keyboard shortcuts

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