streamio

package
v0.56.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package streamio contains wrappers intended for turning gRPC streams that send/receive messages with a []byte field into io.Writers and io.Readers.

Index

Constants

This section is empty.

Variables

View Source
var WriteBufferSize = 128 * 1024

WriteBufferSize is the largest []byte that Write() will pass to its underlying send function. This value can be changed at runtime using the GITALY_STREAMIO_WRITE_BUFFER_SIZE environment variable.

Functions

func NewReader

func NewReader(receiver func() ([]byte, error)) io.Reader

NewReader turns receiver into an io.Reader. Errors from the receiver function are passed on unmodified. This means receiver should emit io.EOF when done.

func NewWriter

func NewWriter(sender func(p []byte) error) io.Writer

NewWriter turns sender into an io.Writer. The sender callback will receive []byte arguments of length at most WriteBufferSize.

Types

This section is empty.

Jump to

Keyboard shortcuts

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