grpcinterface

package
v0.0.0-...-a2e7767 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2020 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BadTimes = errors.New("Invalid time range")
View Source
var BadUUID = errors.New("Invalid uuid")
View Source
var ErrBadTimes = &Status{
	Code: 402,
	Msg:  "Invalid time range",
}
View Source
var ErrBadUUID = &Status{
	Code: 400,
	Msg:  "Invalid uuid",
}
View Source
var ErrTooManyRequests = &Status{
	Code: 504,
	Msg:  "Too many requests",
}
View Source
var File_github_com_iznauy_BTrDB_grpcinterface_btrdb_proto protoreflect.FileDescriptor
View Source
var Success = &Status{
	Code: 0,
	Msg:  "",
}
View Source
var TooManyRequests = errors.New("Too many requests")

Functions

func RegisterBTrDBServer

func RegisterBTrDBServer(s *grpc.Server, srv BTrDBServer)

func ServeGRPC

func ServeGRPC(q *btrdb2.Quasar, config *GrpcConfig)

Types

type BTrDBClient

type BTrDBClient interface {
	Insert(ctx context.Context, in *InsertRequest, opts ...grpc.CallOption) (*InsertResponse, error)
	BatchInsert(ctx context.Context, in *BatchInsertRequest, opts ...grpc.CallOption) (*BatchInsertResponse, error)
	Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
	QueryRange(ctx context.Context, in *QueryRangeRequest, opts ...grpc.CallOption) (*QueryRangeResponse, error)
	QueryNearestValue(ctx context.Context, in *QueryNearestValueRequest, opts ...grpc.CallOption) (*QueryNearestValueResponse, error)
	QueryStatistics(ctx context.Context, in *QueryStatisticsRequest, opts ...grpc.CallOption) (*QueryStatisticsResponse, error)
}

BTrDBClient is the client API for BTrDB service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewBTrDBClient

func NewBTrDBClient(cc grpc.ClientConnInterface) BTrDBClient

type BatchInsertRequest

type BatchInsertRequest struct {
	Inserts []*InsertRequest `protobuf:"bytes,1,rep,name=inserts,proto3" json:"inserts,omitempty"`
	// contains filtered or unexported fields
}

func (*BatchInsertRequest) Descriptor deprecated

func (*BatchInsertRequest) Descriptor() ([]byte, []int)

Deprecated: Use BatchInsertRequest.ProtoReflect.Descriptor instead.

func (*BatchInsertRequest) GetInserts

func (x *BatchInsertRequest) GetInserts() []*InsertRequest

func (*BatchInsertRequest) ProtoMessage

func (*BatchInsertRequest) ProtoMessage()

func (*BatchInsertRequest) ProtoReflect

func (x *BatchInsertRequest) ProtoReflect() protoreflect.Message

func (*BatchInsertRequest) Reset

func (x *BatchInsertRequest) Reset()

func (*BatchInsertRequest) String

func (x *BatchInsertRequest) String() string

type BatchInsertResponse

type BatchInsertResponse struct {
	Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*BatchInsertResponse) Descriptor deprecated

func (*BatchInsertResponse) Descriptor() ([]byte, []int)

Deprecated: Use BatchInsertResponse.ProtoReflect.Descriptor instead.

func (*BatchInsertResponse) GetStatus

func (x *BatchInsertResponse) GetStatus() *Status

func (*BatchInsertResponse) ProtoMessage

func (*BatchInsertResponse) ProtoMessage()

func (*BatchInsertResponse) ProtoReflect

func (x *BatchInsertResponse) ProtoReflect() protoreflect.Message

func (*BatchInsertResponse) Reset

func (x *BatchInsertResponse) Reset()

func (*BatchInsertResponse) String

func (x *BatchInsertResponse) String() string

type DeleteRequest

type DeleteRequest struct {
	Uuid  []byte `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	Start int64  `protobuf:"fixed64,2,opt,name=start,proto3" json:"start,omitempty"`
	End   int64  `protobuf:"fixed64,3,opt,name=end,proto3" json:"end,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteRequest) Descriptor deprecated

func (*DeleteRequest) Descriptor() ([]byte, []int)

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetEnd

func (x *DeleteRequest) GetEnd() int64

func (*DeleteRequest) GetStart

func (x *DeleteRequest) GetStart() int64

func (*DeleteRequest) GetUuid

func (x *DeleteRequest) GetUuid() []byte

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) ProtoReflect

func (x *DeleteRequest) ProtoReflect() protoreflect.Message

func (*DeleteRequest) Reset

func (x *DeleteRequest) Reset()

func (*DeleteRequest) String

func (x *DeleteRequest) String() string

type DeleteResponse

type DeleteResponse struct {
	Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteResponse) Descriptor deprecated

func (*DeleteResponse) Descriptor() ([]byte, []int)

Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.

func (*DeleteResponse) GetStatus

func (x *DeleteResponse) GetStatus() *Status

func (*DeleteResponse) ProtoMessage

func (*DeleteResponse) ProtoMessage()

func (*DeleteResponse) ProtoReflect

func (x *DeleteResponse) ProtoReflect() protoreflect.Message

func (*DeleteResponse) Reset

func (x *DeleteResponse) Reset()

func (*DeleteResponse) String

func (x *DeleteResponse) String() string

type GrpcConfig

type GrpcConfig struct {
	Address string

	UseRateLimiter bool
	ReadLimit      int64
	WriteLimit     int64
	LimitVariable  bool
}

type GrpcInterface

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

func (*GrpcInterface) BatchInsert

func (g *GrpcInterface) BatchInsert(ctx context.Context, batchReq *BatchInsertRequest) (*BatchInsertResponse, error)

func (*GrpcInterface) Delete

func (*GrpcInterface) Insert

func (*GrpcInterface) QueryNearestValue

func (*GrpcInterface) QueryRange

func (*GrpcInterface) QueryStatistics

type GrpcReadRequest

type GrpcReadRequest interface {
	// contains filtered or unexported methods
}

type GrpcWriteRequest

type GrpcWriteRequest interface {
	// contains filtered or unexported methods
}

type InsertRequest

type InsertRequest struct {
	Uuid   []byte      `protobuf:"bytes,2,opt,name=uuid,proto3" json:"uuid,omitempty"`
	Values []*RawPoint `protobuf:"bytes,3,rep,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}

func (*InsertRequest) Descriptor deprecated

func (*InsertRequest) Descriptor() ([]byte, []int)

Deprecated: Use InsertRequest.ProtoReflect.Descriptor instead.

func (*InsertRequest) GetUuid

func (x *InsertRequest) GetUuid() []byte

func (*InsertRequest) GetValues

func (x *InsertRequest) GetValues() []*RawPoint

func (*InsertRequest) ProtoMessage

func (*InsertRequest) ProtoMessage()

func (*InsertRequest) ProtoReflect

func (x *InsertRequest) ProtoReflect() protoreflect.Message

func (*InsertRequest) Reset

func (x *InsertRequest) Reset()

func (*InsertRequest) String

func (x *InsertRequest) String() string

type InsertResponse

type InsertResponse struct {
	Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*InsertResponse) Descriptor deprecated

func (*InsertResponse) Descriptor() ([]byte, []int)

Deprecated: Use InsertResponse.ProtoReflect.Descriptor instead.

func (*InsertResponse) GetStatus

func (x *InsertResponse) GetStatus() *Status

func (*InsertResponse) ProtoMessage

func (*InsertResponse) ProtoMessage()

func (*InsertResponse) ProtoReflect

func (x *InsertResponse) ProtoReflect() protoreflect.Message

func (*InsertResponse) Reset

func (x *InsertResponse) Reset()

func (*InsertResponse) String

func (x *InsertResponse) String() string

type QueryNearestValueRequest

type QueryNearestValueRequest struct {
	Uuid      []byte `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	Time      int64  `protobuf:"fixed64,2,opt,name=time,proto3" json:"time,omitempty"`
	Version   uint64 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"`
	Backwards bool   `protobuf:"varint,4,opt,name=backwards,proto3" json:"backwards,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryNearestValueRequest) Descriptor deprecated

func (*QueryNearestValueRequest) Descriptor() ([]byte, []int)

Deprecated: Use QueryNearestValueRequest.ProtoReflect.Descriptor instead.

func (*QueryNearestValueRequest) GetBackwards

func (x *QueryNearestValueRequest) GetBackwards() bool

func (*QueryNearestValueRequest) GetTime

func (x *QueryNearestValueRequest) GetTime() int64

func (*QueryNearestValueRequest) GetUuid

func (x *QueryNearestValueRequest) GetUuid() []byte

func (*QueryNearestValueRequest) GetVersion

func (x *QueryNearestValueRequest) GetVersion() uint64

func (*QueryNearestValueRequest) ProtoMessage

func (*QueryNearestValueRequest) ProtoMessage()

func (*QueryNearestValueRequest) ProtoReflect

func (x *QueryNearestValueRequest) ProtoReflect() protoreflect.Message

func (*QueryNearestValueRequest) Reset

func (x *QueryNearestValueRequest) Reset()

func (*QueryNearestValueRequest) String

func (x *QueryNearestValueRequest) String() string

type QueryNearestValueResponse

type QueryNearestValueResponse struct {
	Status  *Status   `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	Version uint64    `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
	Value   *RawPoint `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryNearestValueResponse) Descriptor deprecated

func (*QueryNearestValueResponse) Descriptor() ([]byte, []int)

Deprecated: Use QueryNearestValueResponse.ProtoReflect.Descriptor instead.

func (*QueryNearestValueResponse) GetStatus

func (x *QueryNearestValueResponse) GetStatus() *Status

func (*QueryNearestValueResponse) GetValue

func (x *QueryNearestValueResponse) GetValue() *RawPoint

func (*QueryNearestValueResponse) GetVersion

func (x *QueryNearestValueResponse) GetVersion() uint64

func (*QueryNearestValueResponse) ProtoMessage

func (*QueryNearestValueResponse) ProtoMessage()

func (*QueryNearestValueResponse) ProtoReflect

func (*QueryNearestValueResponse) Reset

func (x *QueryNearestValueResponse) Reset()

func (*QueryNearestValueResponse) String

func (x *QueryNearestValueResponse) String() string

type QueryRangeRequest

type QueryRangeRequest struct {
	Uuid    []byte `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	Start   int64  `protobuf:"fixed64,2,opt,name=start,proto3" json:"start,omitempty"`
	End     int64  `protobuf:"fixed64,3,opt,name=end,proto3" json:"end,omitempty"`
	Version uint64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryRangeRequest) Descriptor deprecated

func (*QueryRangeRequest) Descriptor() ([]byte, []int)

Deprecated: Use QueryRangeRequest.ProtoReflect.Descriptor instead.

func (*QueryRangeRequest) GetEnd

func (x *QueryRangeRequest) GetEnd() int64

func (*QueryRangeRequest) GetStart

func (x *QueryRangeRequest) GetStart() int64

func (*QueryRangeRequest) GetUuid

func (x *QueryRangeRequest) GetUuid() []byte

func (*QueryRangeRequest) GetVersion

func (x *QueryRangeRequest) GetVersion() uint64

func (*QueryRangeRequest) ProtoMessage

func (*QueryRangeRequest) ProtoMessage()

func (*QueryRangeRequest) ProtoReflect

func (x *QueryRangeRequest) ProtoReflect() protoreflect.Message

func (*QueryRangeRequest) Reset

func (x *QueryRangeRequest) Reset()

func (*QueryRangeRequest) String

func (x *QueryRangeRequest) String() string

type QueryRangeResponse

type QueryRangeResponse struct {
	Status  *Status     `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	Version uint64      `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
	Values  []*RawPoint `protobuf:"bytes,3,rep,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryRangeResponse) Descriptor deprecated

func (*QueryRangeResponse) Descriptor() ([]byte, []int)

Deprecated: Use QueryRangeResponse.ProtoReflect.Descriptor instead.

func (*QueryRangeResponse) GetStatus

func (x *QueryRangeResponse) GetStatus() *Status

func (*QueryRangeResponse) GetValues

func (x *QueryRangeResponse) GetValues() []*RawPoint

func (*QueryRangeResponse) GetVersion

func (x *QueryRangeResponse) GetVersion() uint64

func (*QueryRangeResponse) ProtoMessage

func (*QueryRangeResponse) ProtoMessage()

func (*QueryRangeResponse) ProtoReflect

func (x *QueryRangeResponse) ProtoReflect() protoreflect.Message

func (*QueryRangeResponse) Reset

func (x *QueryRangeResponse) Reset()

func (*QueryRangeResponse) String

func (x *QueryRangeResponse) String() string

type QueryStatisticsRequest

type QueryStatisticsRequest struct {
	Uuid       []byte `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	Start      int64  `protobuf:"fixed64,2,opt,name=start,proto3" json:"start,omitempty"`
	End        int64  `protobuf:"fixed64,3,opt,name=end,proto3" json:"end,omitempty"`
	Version    uint64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"`
	Resolution uint32 `protobuf:"varint,5,opt,name=resolution,proto3" json:"resolution,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryStatisticsRequest) Descriptor deprecated

func (*QueryStatisticsRequest) Descriptor() ([]byte, []int)

Deprecated: Use QueryStatisticsRequest.ProtoReflect.Descriptor instead.

func (*QueryStatisticsRequest) GetEnd

func (x *QueryStatisticsRequest) GetEnd() int64

func (*QueryStatisticsRequest) GetResolution

func (x *QueryStatisticsRequest) GetResolution() uint32

func (*QueryStatisticsRequest) GetStart

func (x *QueryStatisticsRequest) GetStart() int64

func (*QueryStatisticsRequest) GetUuid

func (x *QueryStatisticsRequest) GetUuid() []byte

func (*QueryStatisticsRequest) GetVersion

func (x *QueryStatisticsRequest) GetVersion() uint64

func (*QueryStatisticsRequest) ProtoMessage

func (*QueryStatisticsRequest) ProtoMessage()

func (*QueryStatisticsRequest) ProtoReflect

func (x *QueryStatisticsRequest) ProtoReflect() protoreflect.Message

func (*QueryStatisticsRequest) Reset

func (x *QueryStatisticsRequest) Reset()

func (*QueryStatisticsRequest) String

func (x *QueryStatisticsRequest) String() string

type QueryStatisticsResponse

type QueryStatisticsResponse struct {
	Status     *Status       `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	Version    uint64        `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
	Statistics []*Statistics `protobuf:"bytes,3,rep,name=statistics,proto3" json:"statistics,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryStatisticsResponse) Descriptor deprecated

func (*QueryStatisticsResponse) Descriptor() ([]byte, []int)

Deprecated: Use QueryStatisticsResponse.ProtoReflect.Descriptor instead.

func (*QueryStatisticsResponse) GetStatistics

func (x *QueryStatisticsResponse) GetStatistics() []*Statistics

func (*QueryStatisticsResponse) GetStatus

func (x *QueryStatisticsResponse) GetStatus() *Status

func (*QueryStatisticsResponse) GetVersion

func (x *QueryStatisticsResponse) GetVersion() uint64

func (*QueryStatisticsResponse) ProtoMessage

func (*QueryStatisticsResponse) ProtoMessage()

func (*QueryStatisticsResponse) ProtoReflect

func (x *QueryStatisticsResponse) ProtoReflect() protoreflect.Message

func (*QueryStatisticsResponse) Reset

func (x *QueryStatisticsResponse) Reset()

func (*QueryStatisticsResponse) String

func (x *QueryStatisticsResponse) String() string

type RateLimiter

type RateLimiter interface {
	Read(req GrpcReadRequest) bool
	Write(req GrpcWriteRequest) bool
}

type RawPoint

type RawPoint struct {
	Time  int64   `protobuf:"fixed64,1,opt,name=time,proto3" json:"time,omitempty"`
	Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*RawPoint) Descriptor deprecated

func (*RawPoint) Descriptor() ([]byte, []int)

Deprecated: Use RawPoint.ProtoReflect.Descriptor instead.

func (*RawPoint) GetTime

func (x *RawPoint) GetTime() int64

func (*RawPoint) GetValue

func (x *RawPoint) GetValue() float64

func (*RawPoint) ProtoMessage

func (*RawPoint) ProtoMessage()

func (*RawPoint) ProtoReflect

func (x *RawPoint) ProtoReflect() protoreflect.Message

func (*RawPoint) Reset

func (x *RawPoint) Reset()

func (*RawPoint) String

func (x *RawPoint) String() string

type Statistics

type Statistics struct {
	Start int64   `protobuf:"fixed64,1,opt,name=start,proto3" json:"start,omitempty"`
	End   int64   `protobuf:"fixed64,2,opt,name=end,proto3" json:"end,omitempty"`
	Count uint64  `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"`
	Min   float64 `protobuf:"fixed64,4,opt,name=min,proto3" json:"min,omitempty"`
	Max   float64 `protobuf:"fixed64,5,opt,name=max,proto3" json:"max,omitempty"`
	Mean  float64 `protobuf:"fixed64,6,opt,name=mean,proto3" json:"mean,omitempty"`
	// contains filtered or unexported fields
}

func (*Statistics) Descriptor deprecated

func (*Statistics) Descriptor() ([]byte, []int)

Deprecated: Use Statistics.ProtoReflect.Descriptor instead.

func (*Statistics) GetCount

func (x *Statistics) GetCount() uint64

func (*Statistics) GetEnd

func (x *Statistics) GetEnd() int64

func (*Statistics) GetMax

func (x *Statistics) GetMax() float64

func (*Statistics) GetMean

func (x *Statistics) GetMean() float64

func (*Statistics) GetMin

func (x *Statistics) GetMin() float64

func (*Statistics) GetStart

func (x *Statistics) GetStart() int64

func (*Statistics) ProtoMessage

func (*Statistics) ProtoMessage()

func (*Statistics) ProtoReflect

func (x *Statistics) ProtoReflect() protoreflect.Message

func (*Statistics) Reset

func (x *Statistics) Reset()

func (*Statistics) String

func (x *Statistics) String() string

type Status

type Status struct {
	Code int32  `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Msg  string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

func (*Status) Descriptor deprecated

func (*Status) Descriptor() ([]byte, []int)

Deprecated: Use Status.ProtoReflect.Descriptor instead.

func (*Status) GetCode

func (x *Status) GetCode() int32

func (*Status) GetMsg

func (x *Status) GetMsg() string

func (*Status) ProtoMessage

func (*Status) ProtoMessage()

func (*Status) ProtoReflect

func (x *Status) ProtoReflect() protoreflect.Message

func (*Status) Reset

func (x *Status) Reset()

func (*Status) String

func (x *Status) String() string

type TestConnectionRequest

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

func (*TestConnectionRequest) Descriptor deprecated

func (*TestConnectionRequest) Descriptor() ([]byte, []int)

Deprecated: Use TestConnectionRequest.ProtoReflect.Descriptor instead.

func (*TestConnectionRequest) ProtoMessage

func (*TestConnectionRequest) ProtoMessage()

func (*TestConnectionRequest) ProtoReflect

func (x *TestConnectionRequest) ProtoReflect() protoreflect.Message

func (*TestConnectionRequest) Reset

func (x *TestConnectionRequest) Reset()

func (*TestConnectionRequest) String

func (x *TestConnectionRequest) String() string

type TestConnectionResponse

type TestConnectionResponse struct {
	Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	// contains filtered or unexported fields
}

func (*TestConnectionResponse) Descriptor deprecated

func (*TestConnectionResponse) Descriptor() ([]byte, []int)

Deprecated: Use TestConnectionResponse.ProtoReflect.Descriptor instead.

func (*TestConnectionResponse) GetSuccess

func (x *TestConnectionResponse) GetSuccess() bool

func (*TestConnectionResponse) ProtoMessage

func (*TestConnectionResponse) ProtoMessage()

func (*TestConnectionResponse) ProtoReflect

func (x *TestConnectionResponse) ProtoReflect() protoreflect.Message

func (*TestConnectionResponse) Reset

func (x *TestConnectionResponse) Reset()

func (*TestConnectionResponse) String

func (x *TestConnectionResponse) String() string

type UnimplementedBTrDBServer

type UnimplementedBTrDBServer struct {
}

UnimplementedBTrDBServer can be embedded to have forward compatible implementations.

func (*UnimplementedBTrDBServer) BatchInsert

func (*UnimplementedBTrDBServer) Delete

func (*UnimplementedBTrDBServer) Insert

func (*UnimplementedBTrDBServer) QueryNearestValue

func (*UnimplementedBTrDBServer) QueryRange

func (*UnimplementedBTrDBServer) QueryStatistics

Jump to

Keyboard shortcuts

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