lines

package
v1.68.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ItemsPerMessage = 20

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

Functions

func CopyAndAppend

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

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