http

package
v0.0.0-...-1fcce7f Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultIdleConnectionTimeout = 90 * time.Second

Variables

View Source
var (
	BackoffError error = fmt.Errorf("backpressure is needed")
)

Functions

This section is empty.

Types

type HTTPWriter

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

HTTPWriter is a Writer that writes to an InfluxDB HTTP server.

func NewHTTPWriter

func NewHTTPWriter(c HTTPWriterConfig) *HTTPWriter

NewHTTPWriter returns a new HTTPWriter from the supplied HTTPWriterConfig.

func (*HTTPWriter) WriteLineProtocol

func (w *HTTPWriter) WriteLineProtocol(body []byte) (int64, error)

WriteLineProtocol writes the given byte slice to the HTTP server described in the Writer's HTTPWriterConfig. It returns the latency in nanoseconds and any error received while sending the data over HTTP, or it returns a new error if the HTTP response isn't as expected.

type HTTPWriterConfig

type HTTPWriterConfig struct {
	// URL of the host, in form "http://example.com:8086"
	Host string

	// Name of the target database into which points will be written.
	Database string

	BackingOffChan chan bool
	BackingOffDone chan struct{}

	// Debug label for more informative errors.
	DebugInfo string
}

HTTPWriterConfig is the configuration used to create an HTTPWriter.

Jump to

Keyboard shortcuts

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