writer

package
v5.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Writers = NewWriters()

Functions

func Init

func Init(opts []Options, globalOpt GlobalOpt) error

Types

type GlobalOpt

type GlobalOpt struct {
	QueueMaxSize  int
	QueuePopSize  int
	SleepInterval int64
}

type Options

type Options struct {
	Url           string
	BasicAuthUser string
	BasicAuthPass string

	Timeout               int64
	DialTimeout           int64
	TLSHandshakeTimeout   int64
	ExpectContinueTimeout int64
	IdleConnTimeout       int64
	KeepAlive             int64

	MaxConnsPerHost     int
	MaxIdleConns        int
	MaxIdleConnsPerHost int
}

type WriterType

type WriterType struct {
	Opts   Options
	Client api.Client
}

func (WriterType) Post

func (w WriterType) Post(req []byte, headers ...map[string]string) error

func (WriterType) Write

func (w WriterType) Write(items []*prompb.TimeSeries, headers ...map[string]string)

type WritersType

type WritersType struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewWriters

func NewWriters() WritersType

func (*WritersType) PushSample added in v5.6.1

func (ws *WritersType) PushSample(ident string, v interface{})

PushSample Push one sample to chan, hash by ident @Author: quzhihao

func (*WritersType) Put

func (ws *WritersType) Put(name string, writer WriterType)

func (*WritersType) StartConsumer added in v5.6.1

func (ws *WritersType) StartConsumer(ident string, ch chan *prompb.TimeSeries)

StartConsumer every ident channel has a consumer, start it @Author: quzhihao

Jump to

Keyboard shortcuts

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