stream

package
v2.260.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Stream

func Stream(ctx context.Context, body io.ReadCloser, transform Transformer, consume Consumer) error

Stream is a generic streamming method that creates 2 go-routines: - one transforms the provided body into another stream by calling the provided transform method - the other consumes the transformed stream using the provided consume method This method block until all work is complete, at which point all Readers and Writers are closed and any error is returned.

Types

type Consumer

type Consumer = func(ctx context.Context, r io.Reader) error

type Transformer

type Transformer = func(ctx context.Context, r io.Reader, w io.Writer) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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