lines

package
v0.84.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MaxMsgSize = 1024 * 128 // 128 KiB

MaxMsgSize establishes the threshold to flush the buffer when using the `Send` function. It's a variable instead of a constant to make it easier to override in tests.

Functions

func CopyAndAppend

func CopyAndAppend(s [][]byte, e []byte) ([][]byte, int)

CopyAndAppend adds a newly allocated copy of `e` to the `s` slice. Useful to avoid io buffer shennanigans

func Send

func Send(r io.Reader, sender Sender, delim []byte) error

Send reads output from `r`, splits it at `delim`, then handles the buffered lines using `sender`.

Types

type Sender

type Sender func([][]byte) error

Sender handles a buffer of lines from a Git command

Jump to

Keyboard shortcuts

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