Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( MetricRowsRpcCall = RPCCall{ Name: "metric_rows", VersionedName: "writeRows_v1", } MetricMetadataRpcCall = RPCCall{ Name: "metricmetadata_rows", VersionedName: "writeMetadata_v1", } )
var ErrRpcIsNotSupported = errors.New("rpcName is not supported by server")
ErrRpcIsNotSupported defines an error when server doesn't support provided rpc version.
Client must close connection to the server.
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
WriteMetadata(mrs []metricsmetadata.Row) error
IsReadOnly() bool
}
API must implement vminsert API.
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.