concurrent

package
v0.0.0-...-1c5f5a9 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

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

func NewMap

func NewMap[K comparable, V any](options ...MapOption[K, V]) *Map[K, V]

func (*Map[K, V]) Delete

func (slf *Map[K, V]) Delete(k K)

func (*Map[K, V]) Exist

func (slf *Map[K, V]) Exist(key K) bool

func (*Map[K, V]) ForEach

func (slf *Map[K, V]) ForEach(f func(K, V))

func (*Map[K, V]) Get

func (slf *Map[K, V]) Get(k K) (V, bool)

func (*Map[K, V]) Keys

func (slf *Map[K, V]) Keys() []K

func (*Map[K, V]) Len

func (slf *Map[K, V]) Len() int

func (*Map[K, V]) Map

func (slf *Map[K, V]) Map() map[K]V

func (*Map[K, V]) MarshalJSON

func (slf *Map[K, V]) MarshalJSON() ([]byte, error)

func (*Map[K, V]) Set

func (slf *Map[K, V]) Set(k K, v V)

func (*Map[K, V]) UnmarshalJSON

func (slf *Map[K, V]) UnmarshalJSON(bytes []byte) error

func (*Map[K, V]) Values

func (slf *Map[K, V]) Values() []V

type MapOption

type MapOption[K comparable, V any] func(*Map[K, V])

func WithMapSource

func WithMapSource[K comparable, V any](source map[K]V) MapOption[K, V]

type Pool

type Pool[T any] struct {
	// contains filtered or unexported fields
}

func NewPool

func NewPool[T any](size int, generator func() T, releaser func(data T)) *Pool[T]

func (*Pool[T]) Close

func (slf *Pool[T]) Close()

func (*Pool[T]) Get

func (slf *Pool[T]) Get() T

func (*Pool[T]) IsClosed

func (slf *Pool[T]) IsClosed() bool

func (*Pool[T]) Release

func (slf *Pool[T]) Release(data T)

Jump to

Keyboard shortcuts

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