Documentation ¶
Index ¶
- func Contains[T comparable](s []T, e T) bool
- func Filter[T any](s []T, f func(T) bool) (res []T)
- func Map[T, V any](s []T, f func(T) V) (res []V)
- func SumAny[T any, V any](s []T, f func(T, V) V, initialVal V) V
- func SumFloat[T any](s []T, f func(T) float64) float64
- type Buffer
- type BufferOptionFunc
- type Observable
- type Observer
- type Queue
- func (q *Queue[Data]) Empty() bool
- func (q *Queue[Data]) Pop() (*Data, bool)
- func (q *Queue[Data]) PopWithFilter(filter func(Data) bool) (*Data, bool)
- func (q *Queue[Data]) Push(d Data)
- func (q *Queue[Data]) ReadQueue() []Data
- func (q *Queue[Data]) RemoveWithCondition(removeCondition func(data Data) bool)
- type QueueOptionFunc
- type RoundRobin
- type Stack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains[T comparable](s []T, e T) bool
Types ¶
type Buffer ¶
type Buffer[T comparable, U any] map[T]U
func ProvideBuffer ¶
func ProvideBuffer[T comparable, U any](ops ...BufferOptionFunc) Buffer[T, U]
func (*Buffer[T, U]) IsObjectInBuffer ¶
type BufferOptionFunc ¶
type BufferOptionFunc func(option *bufferOption)
func WithBufferMetrics ¶
func WithBufferMetrics(meter metric.Meter, metricName string, opts ...metric.Int64ObservableCounterOption) BufferOptionFunc
type Observable ¶ added in v0.0.14
type Queue ¶
type Queue[Data any] struct { // contains filtered or unexported fields }
Queue is a FIFO (First in Last out) queue data structure
func ProvideQueue ¶
func ProvideQueue[Data any](ops ...QueueOptionFunc) Queue[Data]
func (*Queue[Data]) PopWithFilter ¶
func (*Queue[Data]) RemoveWithCondition ¶
type QueueOptionFunc ¶
type QueueOptionFunc func(option *queueOption)
func WithQueueMetrics ¶
func WithQueueMetrics(meter metric.Meter, metricName string, opts ...metric.Int64ObservableCounterOption) QueueOptionFunc
func WithQueueSize ¶
func WithQueueSize(size int) QueueOptionFunc
type RoundRobin ¶
type RoundRobin[T any] interface { Next() T }
func ProvideRoundRobin ¶
func ProvideRoundRobin[T any](data ...T) (RoundRobin[T], error)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package mock_datastructure is a generated GoMock package.
|
Package mock_datastructure is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.