Major update to the data service. Added gRPC and socket servers. Switched to using only a single go.mod at the root.
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
module gitlab.michelsen.id/phillmichelsen/tessera/pkg
|
||||
|
||||
go 1.24.2
|
||||
549
pkg/pb/data_service/data_service_streaming.pb.go
Normal file
549
pkg/pb/data_service/data_service_streaming.pb.go
Normal file
@@ -0,0 +1,549 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.6
|
||||
// protoc v6.31.1
|
||||
// source: pkg/pb/data_service/data_service_streaming.proto
|
||||
|
||||
package data_service
|
||||
|
||||
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)
|
||||
)
|
||||
|
||||
type Identifier struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` // e.g., "binance"
|
||||
Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` // e.g., "BTCUSDT"
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Identifier) Reset() {
|
||||
*x = Identifier{}
|
||||
mi := &file_pkg_pb_data_service_data_service_streaming_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Identifier) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Identifier) ProtoMessage() {}
|
||||
|
||||
func (x *Identifier) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pkg_pb_data_service_data_service_streaming_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 Identifier.ProtoReflect.Descriptor instead.
|
||||
func (*Identifier) Descriptor() ([]byte, []int) {
|
||||
return file_pkg_pb_data_service_data_service_streaming_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Identifier) GetProvider() string {
|
||||
if x != nil {
|
||||
return x.Provider
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Identifier) GetSubject() string {
|
||||
if x != nil {
|
||||
return x.Subject
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type Message struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Identifier *Identifier `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"`
|
||||
Payload string `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` // JSON-encoded data
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Message) Reset() {
|
||||
*x = Message{}
|
||||
mi := &file_pkg_pb_data_service_data_service_streaming_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Message) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Message) ProtoMessage() {}
|
||||
|
||||
func (x *Message) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pkg_pb_data_service_data_service_streaming_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 Message.ProtoReflect.Descriptor instead.
|
||||
func (*Message) Descriptor() ([]byte, []int) {
|
||||
return file_pkg_pb_data_service_data_service_streaming_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *Message) GetIdentifier() *Identifier {
|
||||
if x != nil {
|
||||
return x.Identifier
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Message) GetPayload() string {
|
||||
if x != nil {
|
||||
return x.Payload
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type StartStreamRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Identifiers []*Identifier `protobuf:"bytes,1,rep,name=identifiers,proto3" json:"identifiers,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *StartStreamRequest) Reset() {
|
||||
*x = StartStreamRequest{}
|
||||
mi := &file_pkg_pb_data_service_data_service_streaming_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *StartStreamRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StartStreamRequest) ProtoMessage() {}
|
||||
|
||||
func (x *StartStreamRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pkg_pb_data_service_data_service_streaming_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 StartStreamRequest.ProtoReflect.Descriptor instead.
|
||||
func (*StartStreamRequest) Descriptor() ([]byte, []int) {
|
||||
return file_pkg_pb_data_service_data_service_streaming_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *StartStreamRequest) GetIdentifiers() []*Identifier {
|
||||
if x != nil {
|
||||
return x.Identifiers
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type StartStreamResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
StreamUuid string `protobuf:"bytes,1,opt,name=stream_uuid,json=streamUuid,proto3" json:"stream_uuid,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *StartStreamResponse) Reset() {
|
||||
*x = StartStreamResponse{}
|
||||
mi := &file_pkg_pb_data_service_data_service_streaming_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *StartStreamResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StartStreamResponse) ProtoMessage() {}
|
||||
|
||||
func (x *StartStreamResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pkg_pb_data_service_data_service_streaming_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 StartStreamResponse.ProtoReflect.Descriptor instead.
|
||||
func (*StartStreamResponse) Descriptor() ([]byte, []int) {
|
||||
return file_pkg_pb_data_service_data_service_streaming_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *StartStreamResponse) GetStreamUuid() string {
|
||||
if x != nil {
|
||||
return x.StreamUuid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type UpdateStreamRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
StreamUuid string `protobuf:"bytes,1,opt,name=stream_uuid,json=streamUuid,proto3" json:"stream_uuid,omitempty"`
|
||||
Identifiers []*Identifier `protobuf:"bytes,2,rep,name=identifiers,proto3" json:"identifiers,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *UpdateStreamRequest) Reset() {
|
||||
*x = UpdateStreamRequest{}
|
||||
mi := &file_pkg_pb_data_service_data_service_streaming_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *UpdateStreamRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*UpdateStreamRequest) ProtoMessage() {}
|
||||
|
||||
func (x *UpdateStreamRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pkg_pb_data_service_data_service_streaming_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 UpdateStreamRequest.ProtoReflect.Descriptor instead.
|
||||
func (*UpdateStreamRequest) Descriptor() ([]byte, []int) {
|
||||
return file_pkg_pb_data_service_data_service_streaming_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *UpdateStreamRequest) GetStreamUuid() string {
|
||||
if x != nil {
|
||||
return x.StreamUuid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *UpdateStreamRequest) GetIdentifiers() []*Identifier {
|
||||
if x != nil {
|
||||
return x.Identifiers
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type UpdateStreamResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *UpdateStreamResponse) Reset() {
|
||||
*x = UpdateStreamResponse{}
|
||||
mi := &file_pkg_pb_data_service_data_service_streaming_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *UpdateStreamResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*UpdateStreamResponse) ProtoMessage() {}
|
||||
|
||||
func (x *UpdateStreamResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pkg_pb_data_service_data_service_streaming_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 UpdateStreamResponse.ProtoReflect.Descriptor instead.
|
||||
func (*UpdateStreamResponse) Descriptor() ([]byte, []int) {
|
||||
return file_pkg_pb_data_service_data_service_streaming_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *UpdateStreamResponse) GetSuccess() bool {
|
||||
if x != nil {
|
||||
return x.Success
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type StopStreamRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
StreamUuid string `protobuf:"bytes,1,opt,name=stream_uuid,json=streamUuid,proto3" json:"stream_uuid,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *StopStreamRequest) Reset() {
|
||||
*x = StopStreamRequest{}
|
||||
mi := &file_pkg_pb_data_service_data_service_streaming_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *StopStreamRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StopStreamRequest) ProtoMessage() {}
|
||||
|
||||
func (x *StopStreamRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pkg_pb_data_service_data_service_streaming_proto_msgTypes[6]
|
||||
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 StopStreamRequest.ProtoReflect.Descriptor instead.
|
||||
func (*StopStreamRequest) Descriptor() ([]byte, []int) {
|
||||
return file_pkg_pb_data_service_data_service_streaming_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *StopStreamRequest) GetStreamUuid() string {
|
||||
if x != nil {
|
||||
return x.StreamUuid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type StopStreamResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *StopStreamResponse) Reset() {
|
||||
*x = StopStreamResponse{}
|
||||
mi := &file_pkg_pb_data_service_data_service_streaming_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *StopStreamResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StopStreamResponse) ProtoMessage() {}
|
||||
|
||||
func (x *StopStreamResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pkg_pb_data_service_data_service_streaming_proto_msgTypes[7]
|
||||
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 StopStreamResponse.ProtoReflect.Descriptor instead.
|
||||
func (*StopStreamResponse) Descriptor() ([]byte, []int) {
|
||||
return file_pkg_pb_data_service_data_service_streaming_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
func (x *StopStreamResponse) GetSuccess() bool {
|
||||
if x != nil {
|
||||
return x.Success
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type ConnectStreamRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
StreamUuid string `protobuf:"bytes,1,opt,name=stream_uuid,json=streamUuid,proto3" json:"stream_uuid,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ConnectStreamRequest) Reset() {
|
||||
*x = ConnectStreamRequest{}
|
||||
mi := &file_pkg_pb_data_service_data_service_streaming_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ConnectStreamRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ConnectStreamRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ConnectStreamRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pkg_pb_data_service_data_service_streaming_proto_msgTypes[8]
|
||||
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 ConnectStreamRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ConnectStreamRequest) Descriptor() ([]byte, []int) {
|
||||
return file_pkg_pb_data_service_data_service_streaming_proto_rawDescGZIP(), []int{8}
|
||||
}
|
||||
|
||||
func (x *ConnectStreamRequest) GetStreamUuid() string {
|
||||
if x != nil {
|
||||
return x.StreamUuid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_pkg_pb_data_service_data_service_streaming_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_pkg_pb_data_service_data_service_streaming_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"0pkg/pb/data_service/data_service_streaming.proto\x12\fdata_service\"B\n" +
|
||||
"\n" +
|
||||
"Identifier\x12\x1a\n" +
|
||||
"\bprovider\x18\x01 \x01(\tR\bprovider\x12\x18\n" +
|
||||
"\asubject\x18\x02 \x01(\tR\asubject\"]\n" +
|
||||
"\aMessage\x128\n" +
|
||||
"\n" +
|
||||
"identifier\x18\x01 \x01(\v2\x18.data_service.IdentifierR\n" +
|
||||
"identifier\x12\x18\n" +
|
||||
"\apayload\x18\x02 \x01(\tR\apayload\"P\n" +
|
||||
"\x12StartStreamRequest\x12:\n" +
|
||||
"\videntifiers\x18\x01 \x03(\v2\x18.data_service.IdentifierR\videntifiers\"6\n" +
|
||||
"\x13StartStreamResponse\x12\x1f\n" +
|
||||
"\vstream_uuid\x18\x01 \x01(\tR\n" +
|
||||
"streamUuid\"r\n" +
|
||||
"\x13UpdateStreamRequest\x12\x1f\n" +
|
||||
"\vstream_uuid\x18\x01 \x01(\tR\n" +
|
||||
"streamUuid\x12:\n" +
|
||||
"\videntifiers\x18\x02 \x03(\v2\x18.data_service.IdentifierR\videntifiers\"0\n" +
|
||||
"\x14UpdateStreamResponse\x12\x18\n" +
|
||||
"\asuccess\x18\x01 \x01(\bR\asuccess\"4\n" +
|
||||
"\x11StopStreamRequest\x12\x1f\n" +
|
||||
"\vstream_uuid\x18\x01 \x01(\tR\n" +
|
||||
"streamUuid\".\n" +
|
||||
"\x12StopStreamResponse\x12\x18\n" +
|
||||
"\asuccess\x18\x01 \x01(\bR\asuccess\"7\n" +
|
||||
"\x14ConnectStreamRequest\x12\x1f\n" +
|
||||
"\vstream_uuid\x18\x01 \x01(\tR\n" +
|
||||
"streamUuid2\xe0\x02\n" +
|
||||
"\x14DataServiceStreaming\x12R\n" +
|
||||
"\vStartStream\x12 .data_service.StartStreamRequest\x1a!.data_service.StartStreamResponse\x12U\n" +
|
||||
"\fUpdateStream\x12!.data_service.UpdateStreamRequest\x1a\".data_service.UpdateStreamResponse\x12O\n" +
|
||||
"\n" +
|
||||
"StopStream\x12\x1f.data_service.StopStreamRequest\x1a .data_service.StopStreamResponse\x12L\n" +
|
||||
"\rConnectStream\x12\".data_service.ConnectStreamRequest\x1a\x15.data_service.Message0\x01BMZKgitlab.michelsen.id/phillmichelsen/tessera/pkg/pb/data_service;data_serviceb\x06proto3"
|
||||
|
||||
var (
|
||||
file_pkg_pb_data_service_data_service_streaming_proto_rawDescOnce sync.Once
|
||||
file_pkg_pb_data_service_data_service_streaming_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_pkg_pb_data_service_data_service_streaming_proto_rawDescGZIP() []byte {
|
||||
file_pkg_pb_data_service_data_service_streaming_proto_rawDescOnce.Do(func() {
|
||||
file_pkg_pb_data_service_data_service_streaming_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_pkg_pb_data_service_data_service_streaming_proto_rawDesc), len(file_pkg_pb_data_service_data_service_streaming_proto_rawDesc)))
|
||||
})
|
||||
return file_pkg_pb_data_service_data_service_streaming_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_pkg_pb_data_service_data_service_streaming_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
|
||||
var file_pkg_pb_data_service_data_service_streaming_proto_goTypes = []any{
|
||||
(*Identifier)(nil), // 0: data_service.Identifier
|
||||
(*Message)(nil), // 1: data_service.Message
|
||||
(*StartStreamRequest)(nil), // 2: data_service.StartStreamRequest
|
||||
(*StartStreamResponse)(nil), // 3: data_service.StartStreamResponse
|
||||
(*UpdateStreamRequest)(nil), // 4: data_service.UpdateStreamRequest
|
||||
(*UpdateStreamResponse)(nil), // 5: data_service.UpdateStreamResponse
|
||||
(*StopStreamRequest)(nil), // 6: data_service.StopStreamRequest
|
||||
(*StopStreamResponse)(nil), // 7: data_service.StopStreamResponse
|
||||
(*ConnectStreamRequest)(nil), // 8: data_service.ConnectStreamRequest
|
||||
}
|
||||
var file_pkg_pb_data_service_data_service_streaming_proto_depIdxs = []int32{
|
||||
0, // 0: data_service.Message.identifier:type_name -> data_service.Identifier
|
||||
0, // 1: data_service.StartStreamRequest.identifiers:type_name -> data_service.Identifier
|
||||
0, // 2: data_service.UpdateStreamRequest.identifiers:type_name -> data_service.Identifier
|
||||
2, // 3: data_service.DataServiceStreaming.StartStream:input_type -> data_service.StartStreamRequest
|
||||
4, // 4: data_service.DataServiceStreaming.UpdateStream:input_type -> data_service.UpdateStreamRequest
|
||||
6, // 5: data_service.DataServiceStreaming.StopStream:input_type -> data_service.StopStreamRequest
|
||||
8, // 6: data_service.DataServiceStreaming.ConnectStream:input_type -> data_service.ConnectStreamRequest
|
||||
3, // 7: data_service.DataServiceStreaming.StartStream:output_type -> data_service.StartStreamResponse
|
||||
5, // 8: data_service.DataServiceStreaming.UpdateStream:output_type -> data_service.UpdateStreamResponse
|
||||
7, // 9: data_service.DataServiceStreaming.StopStream:output_type -> data_service.StopStreamResponse
|
||||
1, // 10: data_service.DataServiceStreaming.ConnectStream:output_type -> data_service.Message
|
||||
7, // [7:11] is the sub-list for method output_type
|
||||
3, // [3:7] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_pkg_pb_data_service_data_service_streaming_proto_init() }
|
||||
func file_pkg_pb_data_service_data_service_streaming_proto_init() {
|
||||
if File_pkg_pb_data_service_data_service_streaming_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_pkg_pb_data_service_data_service_streaming_proto_rawDesc), len(file_pkg_pb_data_service_data_service_streaming_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 9,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_pkg_pb_data_service_data_service_streaming_proto_goTypes,
|
||||
DependencyIndexes: file_pkg_pb_data_service_data_service_streaming_proto_depIdxs,
|
||||
MessageInfos: file_pkg_pb_data_service_data_service_streaming_proto_msgTypes,
|
||||
}.Build()
|
||||
File_pkg_pb_data_service_data_service_streaming_proto = out.File
|
||||
file_pkg_pb_data_service_data_service_streaming_proto_goTypes = nil
|
||||
file_pkg_pb_data_service_data_service_streaming_proto_depIdxs = nil
|
||||
}
|
||||
53
pkg/pb/data_service/data_service_streaming.proto
Normal file
53
pkg/pb/data_service/data_service_streaming.proto
Normal file
@@ -0,0 +1,53 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package data_service;
|
||||
|
||||
option go_package = "gitlab.michelsen.id/phillmichelsen/tessera/pkg/pb/data_service;data_service";
|
||||
|
||||
service DataServiceStreaming {
|
||||
rpc StartStream(StartStreamRequest) returns (StartStreamResponse);
|
||||
rpc UpdateStream(UpdateStreamRequest) returns (UpdateStreamResponse);
|
||||
rpc StopStream(StopStreamRequest) returns (StopStreamResponse);
|
||||
|
||||
rpc ConnectStream(ConnectStreamRequest) returns (stream Message);
|
||||
}
|
||||
|
||||
message Identifier {
|
||||
string provider = 1; // e.g., "binance"
|
||||
string subject = 2; // e.g., "BTCUSDT"
|
||||
}
|
||||
|
||||
message Message {
|
||||
Identifier identifier = 1;
|
||||
string payload = 2; // JSON-encoded data
|
||||
}
|
||||
|
||||
message StartStreamRequest {
|
||||
repeated Identifier identifiers = 1;
|
||||
}
|
||||
|
||||
message StartStreamResponse {
|
||||
string stream_uuid = 1;
|
||||
}
|
||||
|
||||
message UpdateStreamRequest {
|
||||
string stream_uuid = 1;
|
||||
repeated Identifier identifiers = 2;
|
||||
}
|
||||
|
||||
message UpdateStreamResponse {
|
||||
bool success = 1;
|
||||
}
|
||||
|
||||
message StopStreamRequest {
|
||||
string stream_uuid = 1;
|
||||
}
|
||||
|
||||
message StopStreamResponse {
|
||||
bool success = 1;
|
||||
}
|
||||
|
||||
|
||||
message ConnectStreamRequest {
|
||||
string stream_uuid = 1;
|
||||
}
|
||||
239
pkg/pb/data_service/data_service_streaming_grpc.pb.go
Normal file
239
pkg/pb/data_service/data_service_streaming_grpc.pb.go
Normal file
@@ -0,0 +1,239 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v6.31.1
|
||||
// source: pkg/pb/data_service/data_service_streaming.proto
|
||||
|
||||
package data_service
|
||||
|
||||
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 (
|
||||
DataServiceStreaming_StartStream_FullMethodName = "/data_service.DataServiceStreaming/StartStream"
|
||||
DataServiceStreaming_UpdateStream_FullMethodName = "/data_service.DataServiceStreaming/UpdateStream"
|
||||
DataServiceStreaming_StopStream_FullMethodName = "/data_service.DataServiceStreaming/StopStream"
|
||||
DataServiceStreaming_ConnectStream_FullMethodName = "/data_service.DataServiceStreaming/ConnectStream"
|
||||
)
|
||||
|
||||
// DataServiceStreamingClient is the client API for DataServiceStreaming 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 DataServiceStreamingClient interface {
|
||||
StartStream(ctx context.Context, in *StartStreamRequest, opts ...grpc.CallOption) (*StartStreamResponse, error)
|
||||
UpdateStream(ctx context.Context, in *UpdateStreamRequest, opts ...grpc.CallOption) (*UpdateStreamResponse, error)
|
||||
StopStream(ctx context.Context, in *StopStreamRequest, opts ...grpc.CallOption) (*StopStreamResponse, error)
|
||||
ConnectStream(ctx context.Context, in *ConnectStreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Message], error)
|
||||
}
|
||||
|
||||
type dataServiceStreamingClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewDataServiceStreamingClient(cc grpc.ClientConnInterface) DataServiceStreamingClient {
|
||||
return &dataServiceStreamingClient{cc}
|
||||
}
|
||||
|
||||
func (c *dataServiceStreamingClient) StartStream(ctx context.Context, in *StartStreamRequest, opts ...grpc.CallOption) (*StartStreamResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StartStreamResponse)
|
||||
err := c.cc.Invoke(ctx, DataServiceStreaming_StartStream_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *dataServiceStreamingClient) UpdateStream(ctx context.Context, in *UpdateStreamRequest, opts ...grpc.CallOption) (*UpdateStreamResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(UpdateStreamResponse)
|
||||
err := c.cc.Invoke(ctx, DataServiceStreaming_UpdateStream_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *dataServiceStreamingClient) StopStream(ctx context.Context, in *StopStreamRequest, opts ...grpc.CallOption) (*StopStreamResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StopStreamResponse)
|
||||
err := c.cc.Invoke(ctx, DataServiceStreaming_StopStream_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *dataServiceStreamingClient) ConnectStream(ctx context.Context, in *ConnectStreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Message], error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &DataServiceStreaming_ServiceDesc.Streams[0], DataServiceStreaming_ConnectStream_FullMethodName, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &grpc.GenericClientStream[ConnectStreamRequest, Message]{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 DataServiceStreaming_ConnectStreamClient = grpc.ServerStreamingClient[Message]
|
||||
|
||||
// DataServiceStreamingServer is the server API for DataServiceStreaming service.
|
||||
// All implementations must embed UnimplementedDataServiceStreamingServer
|
||||
// for forward compatibility.
|
||||
type DataServiceStreamingServer interface {
|
||||
StartStream(context.Context, *StartStreamRequest) (*StartStreamResponse, error)
|
||||
UpdateStream(context.Context, *UpdateStreamRequest) (*UpdateStreamResponse, error)
|
||||
StopStream(context.Context, *StopStreamRequest) (*StopStreamResponse, error)
|
||||
ConnectStream(*ConnectStreamRequest, grpc.ServerStreamingServer[Message]) error
|
||||
mustEmbedUnimplementedDataServiceStreamingServer()
|
||||
}
|
||||
|
||||
// UnimplementedDataServiceStreamingServer 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 UnimplementedDataServiceStreamingServer struct{}
|
||||
|
||||
func (UnimplementedDataServiceStreamingServer) StartStream(context.Context, *StartStreamRequest) (*StartStreamResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method StartStream not implemented")
|
||||
}
|
||||
func (UnimplementedDataServiceStreamingServer) UpdateStream(context.Context, *UpdateStreamRequest) (*UpdateStreamResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateStream not implemented")
|
||||
}
|
||||
func (UnimplementedDataServiceStreamingServer) StopStream(context.Context, *StopStreamRequest) (*StopStreamResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method StopStream not implemented")
|
||||
}
|
||||
func (UnimplementedDataServiceStreamingServer) ConnectStream(*ConnectStreamRequest, grpc.ServerStreamingServer[Message]) error {
|
||||
return status.Errorf(codes.Unimplemented, "method ConnectStream not implemented")
|
||||
}
|
||||
func (UnimplementedDataServiceStreamingServer) mustEmbedUnimplementedDataServiceStreamingServer() {}
|
||||
func (UnimplementedDataServiceStreamingServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeDataServiceStreamingServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to DataServiceStreamingServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeDataServiceStreamingServer interface {
|
||||
mustEmbedUnimplementedDataServiceStreamingServer()
|
||||
}
|
||||
|
||||
func RegisterDataServiceStreamingServer(s grpc.ServiceRegistrar, srv DataServiceStreamingServer) {
|
||||
// If the following call pancis, it indicates UnimplementedDataServiceStreamingServer 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(&DataServiceStreaming_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _DataServiceStreaming_StartStream_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(StartStreamRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DataServiceStreamingServer).StartStream(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: DataServiceStreaming_StartStream_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DataServiceStreamingServer).StartStream(ctx, req.(*StartStreamRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DataServiceStreaming_UpdateStream_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateStreamRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DataServiceStreamingServer).UpdateStream(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: DataServiceStreaming_UpdateStream_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DataServiceStreamingServer).UpdateStream(ctx, req.(*UpdateStreamRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DataServiceStreaming_StopStream_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(StopStreamRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DataServiceStreamingServer).StopStream(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: DataServiceStreaming_StopStream_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DataServiceStreamingServer).StopStream(ctx, req.(*StopStreamRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DataServiceStreaming_ConnectStream_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
m := new(ConnectStreamRequest)
|
||||
if err := stream.RecvMsg(m); err != nil {
|
||||
return err
|
||||
}
|
||||
return srv.(DataServiceStreamingServer).ConnectStream(m, &grpc.GenericServerStream[ConnectStreamRequest, Message]{ServerStream: stream})
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type DataServiceStreaming_ConnectStreamServer = grpc.ServerStreamingServer[Message]
|
||||
|
||||
// DataServiceStreaming_ServiceDesc is the grpc.ServiceDesc for DataServiceStreaming service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var DataServiceStreaming_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "data_service.DataServiceStreaming",
|
||||
HandlerType: (*DataServiceStreamingServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "StartStream",
|
||||
Handler: _DataServiceStreaming_StartStream_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateStream",
|
||||
Handler: _DataServiceStreaming_UpdateStream_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "StopStream",
|
||||
Handler: _DataServiceStreaming_StopStream_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "ConnectStream",
|
||||
Handler: _DataServiceStreaming_ConnectStream_Handler,
|
||||
ServerStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "pkg/pb/data_service/data_service_streaming.proto",
|
||||
}
|
||||
Reference in New Issue
Block a user