Documentation ¶
Index ¶
- Constants
- Variables
- func ScanLines(data []byte, atEOF bool) (advance int, token []byte, err error)
- type BatchWriter
- type BufferBatcher
- type BytesPerSec
- type Client
- type DryRunClient
- type HttpClient
- type InputCompression
- type InputFormat
- type LineReader
- type MultiInputLineReader
- type Params
- type RateLimiter
- type Throttler
Constants ¶
View Source
const ( // DefaultMaxBytes is 500KB; this is typically 250 to 500 lines. DefaultMaxBytes = 500000 // DefaultInterval will flush every 10 seconds. DefaultInterval = 10 * time.Second )
Variables ¶
View Source
var ( // ErrLineTooLong is the error returned when reading a line that exceeds MaxLineLength. ErrLineTooLong = errors.New("batcher: line too long") )
View Source
var ErrWriteCanceled = errors.New("write canceled")
Functions ¶
Types ¶
type BatchWriter ¶
type BufferBatcher ¶
type BufferBatcher struct { MaxFlushBytes int // MaxFlushBytes is the maximum number of bytes to buffer before flushing MaxFlushInterval time.Duration // MaxFlushInterval is the maximum amount of time to wait before flushing MaxLineLength int // MaxLineLength specifies the maximum length of a single line }
BufferBatcher batches line protocol for sends to output.
func (*BufferBatcher) WriteBatches ¶
func (b *BufferBatcher) WriteBatches(ctx context.Context, r io.Reader, writeFn func(batch []byte) error) error
WriteBatches reads batches from r, passing them on to an arbitrary writeFn.
type BytesPerSec ¶
type BytesPerSec float64
func ToBytesPerSecond ¶
func ToBytesPerSecond(rateLimit string) (BytesPerSec, error)
ToBytesPerSecond converts rate from string to number. The supplied string value format must be COUNT(B|kB|MB)/TIME(s|sec|m|min) with / and TIME being optional. All spaces are ignored, they can help with formatting. Examples: "5 MB / 5 min", 17kbs. 5.1MB5m.
func (*BytesPerSec) Set ¶
func (b *BytesPerSec) Set(v string) (err error)
func (BytesPerSec) String ¶
func (b BytesPerSec) String() string
type Client ¶
type Client struct { clients.CLI api.WriteApi LineReader RateLimiter BatchWriter }
type DryRunClient ¶
type DryRunClient struct { clients.CLI LineReader }
func (DryRunClient) WriteDryRun ¶
func (c DryRunClient) WriteDryRun(ctx context.Context) error
type InputCompression ¶
type InputCompression int
const ( InputCompressionDerived InputCompression = iota InputCompressionGZIP InputCompressionNone )
func (*InputCompression) Set ¶
func (i *InputCompression) Set(v string) error
func (InputCompression) String ¶
func (i InputCompression) String() string
type InputFormat ¶
type InputFormat int
const ( InputFormatDerived InputFormat = iota InputFormatCSV InputFormatLP )
func (*InputFormat) Set ¶
func (i *InputFormat) Set(v string) error
func (InputFormat) String ¶
func (i InputFormat) String() string
type LineReader ¶
type MultiInputLineReader ¶
type MultiInputLineReader struct { StdIn io.Reader HttpClient HttpClient ErrorOut io.Writer Args []string Files []string URLs []string Format InputFormat Compression InputCompression Encoding string // CSV-specific options. Headers []string SkipRowOnError bool SkipHeader int IgnoreDataTypeInColumnName bool Debug bool }
type Params ¶
type Params struct { clients.OrgBucketParams Precision api.WritePrecision }
type RateLimiter ¶
Click to show internal directories.
Click to hide internal directories.