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 ¶
CopyAndAppend adds a newly allocated copy of `e` to the `s` slice. Useful to avoid io buffer shennanigans
Types ¶
type SenderOpts ¶
type SenderOpts struct { // Delimiter is the separator used to split the sender's output into // lines. Defaults to an empty byte (0). Delimiter byte // Limit is the upper limit of how many lines will be sent. The zero // value will cause no lines to be sent. Limit int // IsPageToken allows control over which results are sent as part of the // response. When IsPageToken evaluates to true for the first time, // results will start to be sent as part of the response. This function // will be called with an empty slice previous to sending the first line // in order to allow sending everything right from the beginning. IsPageToken func([]byte) bool // When PageTokenError is true than Sender will return an error when provided // PageToken is not found. PageTokenError bool // Filter limits sent results to those that pass the filter. The zero // value (nil) disables filtering. Filter *regexp.Regexp }
SenderOpts contains fields that Send() uses to determine what is considered a line, and how to handle pagination. That is, how many lines to skip, before a line gets fed into the Sender.
Click to show internal directories.
Click to hide internal directories.