util

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: Apache-2.0 Imports: 2 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bridge added in v0.0.1

func Bridge[T any](ctx context.Context, chanStream <-chan <-chan T) <-chan T

Bridge joins transforms a series of channels into a single channel

func FanIn added in v0.0.1

func FanIn[T any](ctx context.Context, streams ...<-chan T) <-chan T

FanIn joins several channels into one

func Or added in v0.0.1

func Or[T any](channels ...<-chan T) <-chan T

Or returns a channel that combines all the specified channels.

func OrDone

func OrDone[T any](ctx context.Context, c <-chan T) <-chan T

OrDone encapsulates the for-select idiom used for many goroutines the idea is that it makes the code easier to read

func Repeat added in v0.0.1

func Repeat[T any](ctx context.Context, values ...T) <-chan T

generator that repeats over and over the values it is given

func RepeatFn added in v0.0.1

func RepeatFn[T any](ctx context.Context, fn func() T) <-chan T

generator that repeats over and over the values it is given

func Take added in v0.0.1

func Take[T any](ctx context.Context, valueStream <-chan T, num int) <-chan T

generator that takes the specified number of elements from a stream

func Tee added in v0.0.1

func Tee[T any](ctx context.Context, in <-chan T) (_, _ <-chan T)

Tee takes one channel of objects and splits it into two channels, duplicating the channels. Much like the `tee` tool in *nix

Types

This section is empty.

Jump to

Keyboard shortcuts

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