backend

package
v0.0.0-...-decdc4a Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultHTTPPingResponse = http.StatusNoContent
	DefaultHTTPTimeout      = 10 * time.Second
	DefaultMaxDelayInterval = 10 * time.Second
	DefaultBatchSizeKB      = 512

	KB = 1024
	MB = 1024 * KB
)

Default HTTP settings and a few constants

Variables

View Source
var ErrBufferFull = errors.New("retry buffer full")

ErrBufferFull error indicates that retry buffer is full

Functions

func ReMapRequest

func ReMapRequest(r *http.Request, params *InfluxParams, path string) *http.Request

REVIEW IF NEEDED !!!

func SetConfig

func SetConfig(cfg *config.Config)

func SetLogdir

func SetLogdir(ld string)

Types

type DbBackend

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

func NewDBBackend

func NewDBBackend(cfg *config.InfluxDBBackend, l *zerolog.Logger, clustername string) (*DbBackend, error)

func (*DbBackend) GetRetryBuffer

func (b *DbBackend) GetRetryBuffer() *retryBuffer

func (*DbBackend) Name

func (b *DbBackend) Name() string

func (*DbBackend) PingURI

func (b *DbBackend) PingURI() string

func (*DbBackend) URL

func (b *DbBackend) URL(uri string) string

type InfluxParams

type InfluxParams struct {
	Header map[config.RuleKey]string
	Query  map[config.RuleKey]string
	Points models.Points
}

func SplitParamsILP

func SplitParamsILP(r *http.Request) *InfluxParams

func SplitParamsIQL

func SplitParamsIQL(r *http.Request) *InfluxParams

func SplitParamsPRW

func SplitParamsPRW(r *http.Request) *InfluxParams

func (*InfluxParams) Clone

func (ip *InfluxParams) Clone() *InfluxParams

func (*InfluxParams) QueryEncode

func (ip *InfluxParams) QueryEncode() string

func (*InfluxParams) SetDB

func (ip *InfluxParams) SetDB(db string)

type Operation

type Operation func() error

Operation -TODO-

type RequestResponses

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

type ResponseData

type ResponseData struct {
	Serverid        string
	Clusterid       string
	Location        string
	ContentType     string
	ContentEncoding string
	StatusCode      int
	Body            []byte
}

func (*ResponseData) MarshalJSON

func (m *ResponseData) MarshalJSON() ([]byte, error)

func (*ResponseData) UnmarshalJSON

func (m *ResponseData) UnmarshalJSON(data []byte) error

func (*ResponseData) Write

func (rd *ResponseData) Write(w http.ResponseWriter)

Jump to

Keyboard shortcuts

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