tpl

package
v0.0.0-...-a4f8eeb Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SafeMap

type SafeMap[K comparable, V any] struct {
	Data sync.Map
}

func (*SafeMap[K, V]) Clear

func (m *SafeMap[K, V]) Clear()

func (*SafeMap[K, V]) Delete

func (m *SafeMap[K, V]) Delete(k K)

func (*SafeMap[K, V]) Elements

func (m *SafeMap[K, V]) Elements() []*SafeMapElement[K, V]

func (*SafeMap[K, V]) Get

func (m *SafeMap[K, V]) Get(k K) (V, bool)

func (*SafeMap[K, V]) Has

func (m *SafeMap[K, V]) Has(k K) bool

func (*SafeMap[K, V]) Keys

func (m *SafeMap[K, V]) Keys() []K

func (*SafeMap[K, V]) Len

func (m *SafeMap[K, V]) Len() int

func (*SafeMap[K, V]) Map

func (m *SafeMap[K, V]) Map() map[K]V

func (*SafeMap[K, V]) MustGet

func (m *SafeMap[K, V]) MustGet(k K) V

func (*SafeMap[K, V]) Range

func (m *SafeMap[K, V]) Range(f func(k K, v V) bool)

func (*SafeMap[K, V]) Set

func (m *SafeMap[K, V]) Set(k K, v V)

func (*SafeMap[K, V]) SetIfAbsent

func (m *SafeMap[K, V]) SetIfAbsent(k K, v V) (V, bool)

func (*SafeMap[K, V]) SortElement

func (m *SafeMap[K, V]) SortElement(f SafeMapSorterFunc[K, V]) []*SafeMapElement[K, V]

func (*SafeMap[K, V]) SortKey

func (m *SafeMap[K, V]) SortKey(f SafeMapSorterFunc[K, V]) []K

func (*SafeMap[K, V]) SortValue

func (m *SafeMap[K, V]) SortValue(f SafeMapSorterFunc[K, V]) []V

func (*SafeMap[K, V]) Values

func (m *SafeMap[K, V]) Values() []V

type SafeMapElement

type SafeMapElement[K comparable, V any] struct {
	Key   K
	Value V
}

type SafeMapSorterFunc

type SafeMapSorterFunc[K comparable, V any] func(a *SafeMapElement[K, V], b *SafeMapElement[K, V]) bool

type SliceFinder

type SliceFinder[T comparable] struct {
	Data map[T]bool
}

func NewSliceFinder

func NewSliceFinder[T comparable](s []T) *SliceFinder[T]

func (*SliceFinder[T]) Add

func (f *SliceFinder[T]) Add(v []T)

func (*SliceFinder[T]) Clear

func (f *SliceFinder[T]) Clear()

func (*SliceFinder[T]) Find

func (f *SliceFinder[T]) Find(v T) bool

func (*SliceFinder[T]) GetSlice

func (f *SliceFinder[T]) GetSlice() []T

func (*SliceFinder[T]) Len

func (f *SliceFinder[T]) Len() int

Jump to

Keyboard shortcuts

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