internal

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Flat added in v0.0.6

func Flat[T any](values [][]T) []T

func Map

func Map[T any, U any](values []T, mapFn func(value T) U) []U

Types

type KeyValue added in v0.0.8

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

type RLockValue added in v0.0.17

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

func NewRLockValue added in v0.0.17

func NewRLockValue[T any](initialValue T) *RLockValue[T]

func (*RLockValue[T]) Load added in v0.0.17

func (v *RLockValue[T]) Load() (T, func())

func (*RLockValue[T]) Store added in v0.0.17

func (v *RLockValue[T]) Store(value T) T

Returns old value

type SyncMap added in v0.0.8

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

func NewSyncMap added in v0.0.8

func NewSyncMap[K comparable, V any](initialKeyValues ...KeyValue[K, V]) *SyncMap[K, V]

func (*SyncMap[K, V]) Clear added in v0.0.20

func (s *SyncMap[K, V]) Clear()

func (*SyncMap[K, V]) Load added in v0.0.8

func (m *SyncMap[K, V]) Load(key K) (V, bool)

Load search on Parent as well

func (*SyncMap[K, V]) LoadOrStore added in v0.0.8

func (m *SyncMap[K, V]) LoadOrStore(key K, value V) (V, bool)

LoadOrStores shallow

func (*SyncMap[K, V]) Remove added in v0.0.20

func (s *SyncMap[K, V]) Remove(key K)

func (*SyncMap[K, V]) Snapshot added in v0.0.18

func (s *SyncMap[K, V]) Snapshot() map[K]V

func (*SyncMap[K, V]) Store added in v0.0.8

func (m *SyncMap[K, V]) Store(key K, value V)

Stores shallow

type SyncSlice added in v0.0.17

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

func NewSyncSlice added in v0.0.17

func NewSyncSlice[T any]() *SyncSlice[T]

func (*SyncSlice[T]) Append added in v0.0.17

func (s *SyncSlice[T]) Append(value T)

func (*SyncSlice[T]) Snapshot added in v0.0.17

func (s *SyncSlice[T]) Snapshot() []T

Directories

Path Synopsis
examples
gin command
gin/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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