Initial commit: stats-gateway gRPC service + dashboard + CLI
This commit is contained in:
@@ -0,0 +1,557 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v7.34.1
|
||||
// source: stats.proto
|
||||
|
||||
package statsv1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// Control message. First frame from client must be HELLO with target.
|
||||
type Frame_Kind int32
|
||||
|
||||
const (
|
||||
Frame_UNKNOWN Frame_Kind = 0
|
||||
Frame_HELLO Frame_Kind = 1
|
||||
Frame_DATA Frame_Kind = 2
|
||||
Frame_CLOSE Frame_Kind = 3
|
||||
)
|
||||
|
||||
// Enum value maps for Frame_Kind.
|
||||
var (
|
||||
Frame_Kind_name = map[int32]string{
|
||||
0: "UNKNOWN",
|
||||
1: "HELLO",
|
||||
2: "DATA",
|
||||
3: "CLOSE",
|
||||
}
|
||||
Frame_Kind_value = map[string]int32{
|
||||
"UNKNOWN": 0,
|
||||
"HELLO": 1,
|
||||
"DATA": 2,
|
||||
"CLOSE": 3,
|
||||
}
|
||||
)
|
||||
|
||||
func (x Frame_Kind) Enum() *Frame_Kind {
|
||||
p := new(Frame_Kind)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x Frame_Kind) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (Frame_Kind) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_stats_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (Frame_Kind) Type() protoreflect.EnumType {
|
||||
return &file_stats_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x Frame_Kind) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Frame_Kind.Descriptor instead.
|
||||
func (Frame_Kind) EnumDescriptor() ([]byte, []int) {
|
||||
return file_stats_proto_rawDescGZIP(), []int{5, 0}
|
||||
}
|
||||
|
||||
type Filter struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Node string `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` // "fl" | "pl1" | "" (all)
|
||||
Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` // 1..1000
|
||||
Since string `protobuf:"bytes,3,opt,name=since,proto3" json:"since,omitempty"` // RFC3339, optional
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Filter) Reset() {
|
||||
*x = Filter{}
|
||||
mi := &file_stats_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Filter) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Filter) ProtoMessage() {}
|
||||
|
||||
func (x *Filter) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_stats_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Filter.ProtoReflect.Descriptor instead.
|
||||
func (*Filter) Descriptor() ([]byte, []int) {
|
||||
return file_stats_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Filter) GetNode() string {
|
||||
if x != nil {
|
||||
return x.Node
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Filter) GetLimit() int32 {
|
||||
if x != nil {
|
||||
return x.Limit
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Filter) GetSince() string {
|
||||
if x != nil {
|
||||
return x.Since
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type Sample struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Node string `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
|
||||
Timestamp string `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // RFC3339
|
||||
HttpLatencyMs float64 `protobuf:"fixed64,3,opt,name=http_latency_ms,json=httpLatencyMs,proto3" json:"http_latency_ms,omitempty"`
|
||||
TcpRttMs float64 `protobuf:"fixed64,4,opt,name=tcp_rtt_ms,json=tcpRttMs,proto3" json:"tcp_rtt_ms,omitempty"`
|
||||
DnsResolveMs float64 `protobuf:"fixed64,5,opt,name=dns_resolve_ms,json=dnsResolveMs,proto3" json:"dns_resolve_ms,omitempty"`
|
||||
TlsHandshakeMs float64 `protobuf:"fixed64,6,opt,name=tls_handshake_ms,json=tlsHandshakeMs,proto3" json:"tls_handshake_ms,omitempty"`
|
||||
ThroughputKbps int64 `protobuf:"varint,7,opt,name=throughput_kbps,json=throughputKbps,proto3" json:"throughput_kbps,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Sample) Reset() {
|
||||
*x = Sample{}
|
||||
mi := &file_stats_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Sample) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Sample) ProtoMessage() {}
|
||||
|
||||
func (x *Sample) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_stats_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Sample.ProtoReflect.Descriptor instead.
|
||||
func (*Sample) Descriptor() ([]byte, []int) {
|
||||
return file_stats_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *Sample) GetNode() string {
|
||||
if x != nil {
|
||||
return x.Node
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Sample) GetTimestamp() string {
|
||||
if x != nil {
|
||||
return x.Timestamp
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Sample) GetHttpLatencyMs() float64 {
|
||||
if x != nil {
|
||||
return x.HttpLatencyMs
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Sample) GetTcpRttMs() float64 {
|
||||
if x != nil {
|
||||
return x.TcpRttMs
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Sample) GetDnsResolveMs() float64 {
|
||||
if x != nil {
|
||||
return x.DnsResolveMs
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Sample) GetTlsHandshakeMs() float64 {
|
||||
if x != nil {
|
||||
return x.TlsHandshakeMs
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Sample) GetThroughputKbps() int64 {
|
||||
if x != nil {
|
||||
return x.ThroughputKbps
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type Range struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Node string `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
|
||||
Since string `protobuf:"bytes,2,opt,name=since,proto3" json:"since,omitempty"`
|
||||
Until string `protobuf:"bytes,3,opt,name=until,proto3" json:"until,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Range) Reset() {
|
||||
*x = Range{}
|
||||
mi := &file_stats_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Range) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Range) ProtoMessage() {}
|
||||
|
||||
func (x *Range) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_stats_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Range.ProtoReflect.Descriptor instead.
|
||||
func (*Range) Descriptor() ([]byte, []int) {
|
||||
return file_stats_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *Range) GetNode() string {
|
||||
if x != nil {
|
||||
return x.Node
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Range) GetSince() string {
|
||||
if x != nil {
|
||||
return x.Since
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Range) GetUntil() string {
|
||||
if x != nil {
|
||||
return x.Until
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type Histogram struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Buckets []*Bucket `protobuf:"bytes,1,rep,name=buckets,proto3" json:"buckets,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Histogram) Reset() {
|
||||
*x = Histogram{}
|
||||
mi := &file_stats_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Histogram) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Histogram) ProtoMessage() {}
|
||||
|
||||
func (x *Histogram) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_stats_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Histogram.ProtoReflect.Descriptor instead.
|
||||
func (*Histogram) Descriptor() ([]byte, []int) {
|
||||
return file_stats_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *Histogram) GetBuckets() []*Bucket {
|
||||
if x != nil {
|
||||
return x.Buckets
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Bucket struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
UpperMs float64 `protobuf:"fixed64,1,opt,name=upper_ms,json=upperMs,proto3" json:"upper_ms,omitempty"`
|
||||
Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Bucket) Reset() {
|
||||
*x = Bucket{}
|
||||
mi := &file_stats_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Bucket) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Bucket) ProtoMessage() {}
|
||||
|
||||
func (x *Bucket) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_stats_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Bucket.ProtoReflect.Descriptor instead.
|
||||
func (*Bucket) Descriptor() ([]byte, []int) {
|
||||
return file_stats_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *Bucket) GetUpperMs() float64 {
|
||||
if x != nil {
|
||||
return x.UpperMs
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Bucket) GetCount() int64 {
|
||||
if x != nil {
|
||||
return x.Count
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type Frame struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Kind Frame_Kind `protobuf:"varint,1,opt,name=kind,proto3,enum=stats.v1.Frame_Kind" json:"kind,omitempty"`
|
||||
Target string `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"` // "ip:port" — only used in HELLO
|
||||
Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` // raw TCP bytes
|
||||
Padding []byte `protobuf:"bytes,4,opt,name=padding,proto3" json:"padding,omitempty"` // random padding для frame-length obfuscation
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Frame) Reset() {
|
||||
*x = Frame{}
|
||||
mi := &file_stats_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Frame) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Frame) ProtoMessage() {}
|
||||
|
||||
func (x *Frame) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_stats_proto_msgTypes[5]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Frame.ProtoReflect.Descriptor instead.
|
||||
func (*Frame) Descriptor() ([]byte, []int) {
|
||||
return file_stats_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *Frame) GetKind() Frame_Kind {
|
||||
if x != nil {
|
||||
return x.Kind
|
||||
}
|
||||
return Frame_UNKNOWN
|
||||
}
|
||||
|
||||
func (x *Frame) GetTarget() string {
|
||||
if x != nil {
|
||||
return x.Target
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Frame) GetPayload() []byte {
|
||||
if x != nil {
|
||||
return x.Payload
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Frame) GetPadding() []byte {
|
||||
if x != nil {
|
||||
return x.Padding
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_stats_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_stats_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\vstats.proto\x12\bstats.v1\"H\n" +
|
||||
"\x06Filter\x12\x12\n" +
|
||||
"\x04node\x18\x01 \x01(\tR\x04node\x12\x14\n" +
|
||||
"\x05limit\x18\x02 \x01(\x05R\x05limit\x12\x14\n" +
|
||||
"\x05since\x18\x03 \x01(\tR\x05since\"\xf9\x01\n" +
|
||||
"\x06Sample\x12\x12\n" +
|
||||
"\x04node\x18\x01 \x01(\tR\x04node\x12\x1c\n" +
|
||||
"\ttimestamp\x18\x02 \x01(\tR\ttimestamp\x12&\n" +
|
||||
"\x0fhttp_latency_ms\x18\x03 \x01(\x01R\rhttpLatencyMs\x12\x1c\n" +
|
||||
"\n" +
|
||||
"tcp_rtt_ms\x18\x04 \x01(\x01R\btcpRttMs\x12$\n" +
|
||||
"\x0edns_resolve_ms\x18\x05 \x01(\x01R\fdnsResolveMs\x12(\n" +
|
||||
"\x10tls_handshake_ms\x18\x06 \x01(\x01R\x0etlsHandshakeMs\x12'\n" +
|
||||
"\x0fthroughput_kbps\x18\a \x01(\x03R\x0ethroughputKbps\"G\n" +
|
||||
"\x05Range\x12\x12\n" +
|
||||
"\x04node\x18\x01 \x01(\tR\x04node\x12\x14\n" +
|
||||
"\x05since\x18\x02 \x01(\tR\x05since\x12\x14\n" +
|
||||
"\x05until\x18\x03 \x01(\tR\x05until\"7\n" +
|
||||
"\tHistogram\x12*\n" +
|
||||
"\abuckets\x18\x01 \x03(\v2\x10.stats.v1.BucketR\abuckets\"9\n" +
|
||||
"\x06Bucket\x12\x19\n" +
|
||||
"\bupper_ms\x18\x01 \x01(\x01R\aupperMs\x12\x14\n" +
|
||||
"\x05count\x18\x02 \x01(\x03R\x05count\"\xb2\x01\n" +
|
||||
"\x05Frame\x12(\n" +
|
||||
"\x04kind\x18\x01 \x01(\x0e2\x14.stats.v1.Frame.KindR\x04kind\x12\x16\n" +
|
||||
"\x06target\x18\x02 \x01(\tR\x06target\x12\x18\n" +
|
||||
"\apayload\x18\x03 \x01(\fR\apayload\x12\x18\n" +
|
||||
"\apadding\x18\x04 \x01(\fR\apadding\"3\n" +
|
||||
"\x04Kind\x12\v\n" +
|
||||
"\aUNKNOWN\x10\x00\x12\t\n" +
|
||||
"\x05HELLO\x10\x01\x12\b\n" +
|
||||
"\x04DATA\x10\x02\x12\t\n" +
|
||||
"\x05CLOSE\x10\x032\xa7\x01\n" +
|
||||
"\vSpeedStatus\x125\n" +
|
||||
"\rRecentResults\x12\x10.stats.v1.Filter\x1a\x10.stats.v1.Sample0\x01\x121\n" +
|
||||
"\tAggregate\x12\x0f.stats.v1.Range\x1a\x13.stats.v1.Histogram\x12.\n" +
|
||||
"\x06Tunnel\x12\x0f.stats.v1.Frame\x1a\x0f.stats.v1.Frame(\x010\x01B9Z7github.com/bergabruh/stats-gateway/gen/stats/v1;statsv1b\x06proto3"
|
||||
|
||||
var (
|
||||
file_stats_proto_rawDescOnce sync.Once
|
||||
file_stats_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_stats_proto_rawDescGZIP() []byte {
|
||||
file_stats_proto_rawDescOnce.Do(func() {
|
||||
file_stats_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_stats_proto_rawDesc), len(file_stats_proto_rawDesc)))
|
||||
})
|
||||
return file_stats_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_stats_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_stats_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_stats_proto_goTypes = []any{
|
||||
(Frame_Kind)(0), // 0: stats.v1.Frame.Kind
|
||||
(*Filter)(nil), // 1: stats.v1.Filter
|
||||
(*Sample)(nil), // 2: stats.v1.Sample
|
||||
(*Range)(nil), // 3: stats.v1.Range
|
||||
(*Histogram)(nil), // 4: stats.v1.Histogram
|
||||
(*Bucket)(nil), // 5: stats.v1.Bucket
|
||||
(*Frame)(nil), // 6: stats.v1.Frame
|
||||
}
|
||||
var file_stats_proto_depIdxs = []int32{
|
||||
5, // 0: stats.v1.Histogram.buckets:type_name -> stats.v1.Bucket
|
||||
0, // 1: stats.v1.Frame.kind:type_name -> stats.v1.Frame.Kind
|
||||
1, // 2: stats.v1.SpeedStatus.RecentResults:input_type -> stats.v1.Filter
|
||||
3, // 3: stats.v1.SpeedStatus.Aggregate:input_type -> stats.v1.Range
|
||||
6, // 4: stats.v1.SpeedStatus.Tunnel:input_type -> stats.v1.Frame
|
||||
2, // 5: stats.v1.SpeedStatus.RecentResults:output_type -> stats.v1.Sample
|
||||
4, // 6: stats.v1.SpeedStatus.Aggregate:output_type -> stats.v1.Histogram
|
||||
6, // 7: stats.v1.SpeedStatus.Tunnel:output_type -> stats.v1.Frame
|
||||
5, // [5:8] is the sub-list for method output_type
|
||||
2, // [2:5] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
2, // [2:2] is the sub-list for extension extendee
|
||||
0, // [0:2] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_stats_proto_init() }
|
||||
func file_stats_proto_init() {
|
||||
if File_stats_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_stats_proto_rawDesc), len(file_stats_proto_rawDesc)),
|
||||
NumEnums: 1,
|
||||
NumMessages: 6,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_stats_proto_goTypes,
|
||||
DependencyIndexes: file_stats_proto_depIdxs,
|
||||
EnumInfos: file_stats_proto_enumTypes,
|
||||
MessageInfos: file_stats_proto_msgTypes,
|
||||
}.Build()
|
||||
File_stats_proto = out.File
|
||||
file_stats_proto_goTypes = nil
|
||||
file_stats_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.1
|
||||
// - protoc v7.34.1
|
||||
// source: stats.proto
|
||||
|
||||
package statsv1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
SpeedStatus_RecentResults_FullMethodName = "/stats.v1.SpeedStatus/RecentResults"
|
||||
SpeedStatus_Aggregate_FullMethodName = "/stats.v1.SpeedStatus/Aggregate"
|
||||
SpeedStatus_Tunnel_FullMethodName = "/stats.v1.SpeedStatus/Tunnel"
|
||||
)
|
||||
|
||||
// SpeedStatusClient is the client API for SpeedStatus service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type SpeedStatusClient interface {
|
||||
// RecentResults streams the last N samples for given filter.
|
||||
RecentResults(ctx context.Context, in *Filter, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Sample], error)
|
||||
// Aggregate returns histogram for a time range.
|
||||
Aggregate(ctx context.Context, in *Range, opts ...grpc.CallOption) (*Histogram, error)
|
||||
// Tunnel is a bidirectional stream for authenticated clients.
|
||||
// Auth: Bearer JWT (HS256) в gRPC metadata "authorization: Bearer <jwt>".
|
||||
// Server validates: signature, exp, scope=="tunnel", optional revocation list.
|
||||
Tunnel(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Frame, Frame], error)
|
||||
}
|
||||
|
||||
type speedStatusClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewSpeedStatusClient(cc grpc.ClientConnInterface) SpeedStatusClient {
|
||||
return &speedStatusClient{cc}
|
||||
}
|
||||
|
||||
func (c *speedStatusClient) RecentResults(ctx context.Context, in *Filter, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Sample], error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &SpeedStatus_ServiceDesc.Streams[0], SpeedStatus_RecentResults_FullMethodName, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &grpc.GenericClientStream[Filter, Sample]{ClientStream: stream}
|
||||
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := x.ClientStream.CloseSend(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type SpeedStatus_RecentResultsClient = grpc.ServerStreamingClient[Sample]
|
||||
|
||||
func (c *speedStatusClient) Aggregate(ctx context.Context, in *Range, opts ...grpc.CallOption) (*Histogram, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Histogram)
|
||||
err := c.cc.Invoke(ctx, SpeedStatus_Aggregate_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *speedStatusClient) Tunnel(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Frame, Frame], error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &SpeedStatus_ServiceDesc.Streams[1], SpeedStatus_Tunnel_FullMethodName, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &grpc.GenericClientStream[Frame, Frame]{ClientStream: stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type SpeedStatus_TunnelClient = grpc.BidiStreamingClient[Frame, Frame]
|
||||
|
||||
// SpeedStatusServer is the server API for SpeedStatus service.
|
||||
// All implementations must embed UnimplementedSpeedStatusServer
|
||||
// for forward compatibility.
|
||||
type SpeedStatusServer interface {
|
||||
// RecentResults streams the last N samples for given filter.
|
||||
RecentResults(*Filter, grpc.ServerStreamingServer[Sample]) error
|
||||
// Aggregate returns histogram for a time range.
|
||||
Aggregate(context.Context, *Range) (*Histogram, error)
|
||||
// Tunnel is a bidirectional stream for authenticated clients.
|
||||
// Auth: Bearer JWT (HS256) в gRPC metadata "authorization: Bearer <jwt>".
|
||||
// Server validates: signature, exp, scope=="tunnel", optional revocation list.
|
||||
Tunnel(grpc.BidiStreamingServer[Frame, Frame]) error
|
||||
mustEmbedUnimplementedSpeedStatusServer()
|
||||
}
|
||||
|
||||
// UnimplementedSpeedStatusServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedSpeedStatusServer struct{}
|
||||
|
||||
func (UnimplementedSpeedStatusServer) RecentResults(*Filter, grpc.ServerStreamingServer[Sample]) error {
|
||||
return status.Error(codes.Unimplemented, "method RecentResults not implemented")
|
||||
}
|
||||
func (UnimplementedSpeedStatusServer) Aggregate(context.Context, *Range) (*Histogram, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Aggregate not implemented")
|
||||
}
|
||||
func (UnimplementedSpeedStatusServer) Tunnel(grpc.BidiStreamingServer[Frame, Frame]) error {
|
||||
return status.Error(codes.Unimplemented, "method Tunnel not implemented")
|
||||
}
|
||||
func (UnimplementedSpeedStatusServer) mustEmbedUnimplementedSpeedStatusServer() {}
|
||||
func (UnimplementedSpeedStatusServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeSpeedStatusServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to SpeedStatusServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeSpeedStatusServer interface {
|
||||
mustEmbedUnimplementedSpeedStatusServer()
|
||||
}
|
||||
|
||||
func RegisterSpeedStatusServer(s grpc.ServiceRegistrar, srv SpeedStatusServer) {
|
||||
// If the following call panics, it indicates UnimplementedSpeedStatusServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&SpeedStatus_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _SpeedStatus_RecentResults_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
m := new(Filter)
|
||||
if err := stream.RecvMsg(m); err != nil {
|
||||
return err
|
||||
}
|
||||
return srv.(SpeedStatusServer).RecentResults(m, &grpc.GenericServerStream[Filter, Sample]{ServerStream: stream})
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type SpeedStatus_RecentResultsServer = grpc.ServerStreamingServer[Sample]
|
||||
|
||||
func _SpeedStatus_Aggregate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Range)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SpeedStatusServer).Aggregate(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: SpeedStatus_Aggregate_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SpeedStatusServer).Aggregate(ctx, req.(*Range))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SpeedStatus_Tunnel_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(SpeedStatusServer).Tunnel(&grpc.GenericServerStream[Frame, Frame]{ServerStream: stream})
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type SpeedStatus_TunnelServer = grpc.BidiStreamingServer[Frame, Frame]
|
||||
|
||||
// SpeedStatus_ServiceDesc is the grpc.ServiceDesc for SpeedStatus service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var SpeedStatus_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "stats.v1.SpeedStatus",
|
||||
HandlerType: (*SpeedStatusServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Aggregate",
|
||||
Handler: _SpeedStatus_Aggregate_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "RecentResults",
|
||||
Handler: _SpeedStatus_RecentResults_Handler,
|
||||
ServerStreams: true,
|
||||
},
|
||||
{
|
||||
StreamName: "Tunnel",
|
||||
Handler: _SpeedStatus_Tunnel_Handler,
|
||||
ServerStreams: true,
|
||||
ClientStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "stats.proto",
|
||||
}
|
||||
Reference in New Issue
Block a user