util

package
v0.11.9 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const MaxBitSetSize = 16

Variables

This section is empty.

Functions

This section is empty.

Types

type BitSet

type BitSet struct {
	// contains filtered or unexported fields
}

BitSet Simplified and compact bitset.

func (*BitSet) Count

func (bs *BitSet) Count() int

func (*BitSet) Set

func (bs *BitSet) Set(idx int)

type Sender

type Sender[U any] interface {
	Send(message *U) error
}

type Stream

type Stream[T any] interface {
	Recv() (*T, error)
}

type StreamReader

type StreamReader interface {
	Run() error
}

func ProcessStream

func ProcessStream[T any, U any](
	ctx context.Context,
	stream Stream[T],
	sender Sender[U],
	handleMessage func(*T) (*U, error),
	labels map[string]string,
	log *slog.Logger) StreamReader

func ReadStream

func ReadStream[T any](
	ctx context.Context,
	stream Stream[T],
	handleMessage func(*T) error,
	labels map[string]string,
	log *slog.Logger) StreamReader

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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