vminsertapi

package
v1.129.0-cluster Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MetricRowsRpcCall = RPCCall{
		Name:          "metric_rows",
		VersionedName: "writeRows_v1",
	}
)

Functions

func SendRPCRequestToConn

func SendRPCRequestToConn(bc *handshake.BufferedConn, rpcName string, buf []byte) error

SendRPCRequestToConn sends given buf over provided bc to the server

func SendToConn

func SendToConn(bc *handshake.BufferedConn, buf []byte) error

SendToConn sends given buf over provided bc to the server

Types

type API

type API interface {
	WriteRows(rows []storage.MetricRow) error
	IsReadOnly() bool
}

API must implement vminsert API.

type RPCCall

type RPCCall struct {
	Name          string
	VersionedName string
}

RPCCall defines rpc call from vminsert to vmstorage

type RequestCtx

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

RequestCtx defines server request context

func NewRequestCtx

func NewRequestCtx(bc *handshake.BufferedConn) *RequestCtx

NewRequestCtx returns new server request context for given BufferedConn

func (*RequestCtx) ReadRPCName

func (ctx *RequestCtx) ReadRPCName() ([]byte, error)

ReadRPCName reads rpc call name from the client

Returned bytes slice is valid until any ctx method call

func (*RequestCtx) WriteErrorMessage

func (ctx *RequestCtx) WriteErrorMessage(err error) error

WriteErrorMessage sends given error to the client

func (*RequestCtx) WriteString

func (ctx *RequestCtx) WriteString(s string) error

WriteString writes provided string to the client

type VMInsertServer

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

VMInsertServer processes connections from vminsert.

func NewVMInsertServer

func NewVMInsertServer(addr string, connectionTimeout time.Duration, listenerName string, api API, tc *tls.Config) (*VMInsertServer, error)

NewVMInsertServer starts VMInsertServer at the given addr serving the given storage.

func (*VMInsertServer) MustStop

func (s *VMInsertServer) MustStop()

MustStop gracefully stops s so it no longer touches s.storage after returning.

Jump to

Keyboard shortcuts

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