containers

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CasCache added in v0.5.0

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

func NewCasCache added in v0.5.0

func NewCasCache[K comparable, V any]() *CasCache[K, V]

func (*CasCache[K, V]) Get added in v0.5.0

func (cc *CasCache[K, V]) Get(
	key K,
) (value V, ok bool)

func (*CasCache[K, V]) GetOrCompute added in v0.5.0

func (cc *CasCache[K, V]) GetOrCompute(
	key K, producer func() (V, error),
) (V, error)

func (*CasCache[K, V]) Length added in v0.5.0

func (cc *CasCache[K, V]) Length() int

func (*CasCache[K, V]) Set added in v0.5.0

func (cc *CasCache[K, V]) Set(
	key K, value V,
)

func (*CasCache[K, V]) SetAll added in v0.5.0

func (cc *CasCache[K, V]) SetAll(
	m map[K]V,
)

func (*CasCache[K, V]) TransformSetAndGet added in v0.5.0

func (cc *CasCache[K, V]) TransformSetAndGet(
	key K, transformer func(old V) (V, error),
) (V, error)

type Channel

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

Channel is based on https://github.com/jtarchie/ringbuffer, but extended with the option to skip waiting on an empty output channel

func NewChannel

func NewChannel[T any](
	size int,
) *Channel[T]

func (*Channel[T]) Close

func (c *Channel[T]) Close()

func (*Channel[T]) Receive

func (c *Channel[T]) Receive() T

func (*Channel[T]) ReceiveChannel

func (c *Channel[T]) ReceiveChannel() <-chan T

func (*Channel[T]) Send

func (c *Channel[T]) Send(
	value T,
)

type Queue

type Queue[E any] struct {
	// contains filtered or unexported fields
}

func NewQueue

func NewQueue[E any](
	maxSize int,
) *Queue[E]

func (*Queue[E]) Close

func (rq *Queue[E]) Close()

func (*Queue[E]) Lock

func (rq *Queue[E]) Lock()

func (*Queue[E]) Pop

func (rq *Queue[E]) Pop() E

func (*Queue[E]) Push

func (rq *Queue[E]) Push(
	v E,
) bool

type RelationCache added in v0.5.0

type RelationCache[V any] struct {
	// contains filtered or unexported fields
}

func NewRelationCache added in v0.5.0

func NewRelationCache[V any]() *RelationCache[V]

func (*RelationCache[V]) Get added in v0.5.0

func (rc *RelationCache[V]) Get(
	oid uint32,
) (value V, present bool)

func (*RelationCache[V]) Set added in v0.5.0

func (rc *RelationCache[V]) Set(
	oid uint32, value V,
)

type UnboundedChannel

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

func MakeUnboundedChannel

func MakeUnboundedChannel[T any](
	initialCapacity int,
) *UnboundedChannel[T]

func (*UnboundedChannel[T]) Close

func (uc *UnboundedChannel[T]) Close()

func (*UnboundedChannel[T]) Receive

func (uc *UnboundedChannel[T]) Receive() T

func (*UnboundedChannel[T]) ReceiveChannel

func (uc *UnboundedChannel[T]) ReceiveChannel() <-chan T

func (*UnboundedChannel[T]) Send

func (uc *UnboundedChannel[T]) Send(
	item T,
)

Jump to

Keyboard shortcuts

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