importer

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	URL        url.URL
	Path       string
	Version    string
	Compressed bool // Whether import data is gzipped.
	PPS        int  // points per second importer imports with.

	ClientConfig     *client.HTTPConfig
	Precision        string
	WriteConsistency string

	SqlDump    bool
	ConfigFile string
}

func NewConfig

func NewConfig() *Config

type Importer

type Importer struct {
	// contains filtered or unexported fields
}

func NewImporter

func NewImporter(c Config) *Importer

func (*Importer) Import

func (i *Importer) Import(f io.Reader) error

Import processes the specified file in the Config and writes the data to the databases in chunks specified by batchSize

func (*Importer) WriteLineProtocol

func (i *Importer) WriteLineProtocol(data, database, retentionPolicy, precision, writeConsistency string) (*Response, error)

WriteLineProtocol takes a string with line returns to delimit each write If successful, error is nil and Response is nil If an error occurs, Response may contain additional information if populated.

type Response

type Response struct {
	Err error
}

Jump to

Keyboard shortcuts

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