modified protobufs to send schemas

This commit is contained in:
Malachy Byrne 2023-03-23 16:23:52 +00:00
parent 502adfed1b
commit b723a82e90
Signed by: malmal200
GPG Key ID: EC21443030A655D9
9 changed files with 1690 additions and 501 deletions

View File

@ -4,10 +4,10 @@ go 1.19
require ( require (
github.com/golang/protobuf v1.5.2 // indirect github.com/golang/protobuf v1.5.2 // indirect
golang.org/x/net v0.5.0 // indirect golang.org/x/net v0.8.0 // indirect
golang.org/x/sys v0.4.0 // indirect golang.org/x/sys v0.6.0 // indirect
golang.org/x/text v0.6.0 // indirect golang.org/x/text v0.8.0 // indirect
google.golang.org/genproto v0.0.0-20230109162033-3c3c17ce83e6 // indirect google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect
google.golang.org/grpc v1.51.0 // indirect google.golang.org/grpc v1.53.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect google.golang.org/protobuf v1.28.1 // indirect
) )

View File

@ -4,15 +4,25 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw= golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw=
golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws=
golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18= golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18=
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k= golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k=
golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto v0.0.0-20230109162033-3c3c17ce83e6 h1:uUn6GsgKK2eCI0bWeRMgRCcqDaQXYDuB+5tXA5Xeg/8= google.golang.org/genproto v0.0.0-20230109162033-3c3c17ce83e6 h1:uUn6GsgKK2eCI0bWeRMgRCcqDaQXYDuB+5tXA5Xeg/8=
google.golang.org/genproto v0.0.0-20230109162033-3c3c17ce83e6/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/genproto v0.0.0-20230109162033-3c3c17ce83e6/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 h1:DdoeryqhaXp1LtT/emMP1BRJPHHKFi5akj/nbx/zNTA=
google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s=
google.golang.org/grpc v1.51.0 h1:E1eGv1FTqoLIdnBCZufiSHgKjlqG6fKFf6pPWtMTh8U= google.golang.org/grpc v1.51.0 h1:E1eGv1FTqoLIdnBCZufiSHgKjlqG6fKFf6pPWtMTh8U=
google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww=
google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc=
google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=

View File

@ -1,164 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.21.12
// source: component.proto
package proto
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
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 Component struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Id int32 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
Text *string `protobuf:"bytes,3,opt,name=text,proto3,oneof" json:"text,omitempty"`
}
func (x *Component) Reset() {
*x = Component{}
if protoimpl.UnsafeEnabled {
mi := &file_component_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Component) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Component) ProtoMessage() {}
func (x *Component) ProtoReflect() protoreflect.Message {
mi := &file_component_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Component.ProtoReflect.Descriptor instead.
func (*Component) Descriptor() ([]byte, []int) {
return file_component_proto_rawDescGZIP(), []int{0}
}
func (x *Component) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *Component) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
func (x *Component) GetText() string {
if x != nil && x.Text != nil {
return *x.Text
}
return ""
}
var File_component_proto protoreflect.FileDescriptor
var file_component_proto_rawDesc = []byte{
0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x08, 0x70, 0x61, 0x6e, 0x6f, 0x70, 0x74, 0x65, 0x73, 0x22, 0x51, 0x0a, 0x09, 0x43,
0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02,
0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x04,
0x74, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x74, 0x65,
0x78, 0x74, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x42, 0x34,
0x5a, 0x32, 0x67, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x6c, 0x61, 0x63, 0x68, 0x79, 0x2e, 0x69, 0x65,
0x2f, 0x6d, 0x61, 0x6c, 0x6d, 0x61, 0x6c, 0x32, 0x30, 0x30, 0x2f, 0x70, 0x61, 0x6e, 0x6f, 0x70,
0x74, 0x65, 0x73, 0x2f, 0x73, 0x72, 0x63, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_component_proto_rawDescOnce sync.Once
file_component_proto_rawDescData = file_component_proto_rawDesc
)
func file_component_proto_rawDescGZIP() []byte {
file_component_proto_rawDescOnce.Do(func() {
file_component_proto_rawDescData = protoimpl.X.CompressGZIP(file_component_proto_rawDescData)
})
return file_component_proto_rawDescData
}
var file_component_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_component_proto_goTypes = []interface{}{
(*Component)(nil), // 0: panoptes.Component
}
var file_component_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_component_proto_init() }
func file_component_proto_init() {
if File_component_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_component_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Component); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_component_proto_msgTypes[0].OneofWrappers = []interface{}{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_component_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_component_proto_goTypes,
DependencyIndexes: file_component_proto_depIdxs,
MessageInfos: file_component_proto_msgTypes,
}.Build()
File_component_proto = out.File
file_component_proto_rawDesc = nil
file_component_proto_goTypes = nil
file_component_proto_depIdxs = nil
}

View File

@ -0,0 +1,481 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.30.0
// protoc v3.21.12
// source: components.proto
package proto
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
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 ComponentType int32
const (
ComponentType_Text ComponentType = 0
ComponentType_Chart ComponentType = 1
)
// Enum value maps for ComponentType.
var (
ComponentType_name = map[int32]string{
0: "Text",
1: "Chart",
}
ComponentType_value = map[string]int32{
"Text": 0,
"Chart": 1,
}
)
func (x ComponentType) Enum() *ComponentType {
p := new(ComponentType)
*p = x
return p
}
func (x ComponentType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (ComponentType) Descriptor() protoreflect.EnumDescriptor {
return file_components_proto_enumTypes[0].Descriptor()
}
func (ComponentType) Type() protoreflect.EnumType {
return &file_components_proto_enumTypes[0]
}
func (x ComponentType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use ComponentType.Descriptor instead.
func (ComponentType) EnumDescriptor() ([]byte, []int) {
return file_components_proto_rawDescGZIP(), []int{0}
}
type Component struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Type ComponentType `protobuf:"varint,3,opt,name=type,proto3,enum=panoptes.ComponentType" json:"type,omitempty"`
}
func (x *Component) Reset() {
*x = Component{}
if protoimpl.UnsafeEnabled {
mi := &file_components_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Component) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Component) ProtoMessage() {}
func (x *Component) ProtoReflect() protoreflect.Message {
mi := &file_components_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Component.ProtoReflect.Descriptor instead.
func (*Component) Descriptor() ([]byte, []int) {
return file_components_proto_rawDescGZIP(), []int{0}
}
func (x *Component) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *Component) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *Component) GetType() ComponentType {
if x != nil {
return x.Type
}
return ComponentType_Text
}
type Schema struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Components []*Component `protobuf:"bytes,1,rep,name=components,proto3" json:"components,omitempty"`
}
func (x *Schema) Reset() {
*x = Schema{}
if protoimpl.UnsafeEnabled {
mi := &file_components_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Schema) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Schema) ProtoMessage() {}
func (x *Schema) ProtoReflect() protoreflect.Message {
mi := &file_components_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Schema.ProtoReflect.Descriptor instead.
func (*Schema) Descriptor() ([]byte, []int) {
return file_components_proto_rawDescGZIP(), []int{1}
}
func (x *Schema) GetComponents() []*Component {
if x != nil {
return x.Components
}
return nil
}
type TextComponent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Id int32 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
Text string `protobuf:"bytes,3,opt,name=text,proto3" json:"text,omitempty"`
Websocket bool `protobuf:"varint,4,opt,name=websocket,proto3" json:"websocket,omitempty"`
}
func (x *TextComponent) Reset() {
*x = TextComponent{}
if protoimpl.UnsafeEnabled {
mi := &file_components_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TextComponent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TextComponent) ProtoMessage() {}
func (x *TextComponent) ProtoReflect() protoreflect.Message {
mi := &file_components_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TextComponent.ProtoReflect.Descriptor instead.
func (*TextComponent) Descriptor() ([]byte, []int) {
return file_components_proto_rawDescGZIP(), []int{2}
}
func (x *TextComponent) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *TextComponent) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
func (x *TextComponent) GetText() string {
if x != nil {
return x.Text
}
return ""
}
func (x *TextComponent) GetWebsocket() bool {
if x != nil {
return x.Websocket
}
return false
}
type ChartComponent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Id int32 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
Labels []string `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty"`
Values []int32 `protobuf:"varint,5,rep,packed,name=values,proto3" json:"values,omitempty"`
Websocket bool `protobuf:"varint,6,opt,name=websocket,proto3" json:"websocket,omitempty"`
}
func (x *ChartComponent) Reset() {
*x = ChartComponent{}
if protoimpl.UnsafeEnabled {
mi := &file_components_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ChartComponent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ChartComponent) ProtoMessage() {}
func (x *ChartComponent) ProtoReflect() protoreflect.Message {
mi := &file_components_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ChartComponent.ProtoReflect.Descriptor instead.
func (*ChartComponent) Descriptor() ([]byte, []int) {
return file_components_proto_rawDescGZIP(), []int{3}
}
func (x *ChartComponent) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *ChartComponent) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
func (x *ChartComponent) GetType() string {
if x != nil {
return x.Type
}
return ""
}
func (x *ChartComponent) GetLabels() []string {
if x != nil {
return x.Labels
}
return nil
}
func (x *ChartComponent) GetValues() []int32 {
if x != nil {
return x.Values
}
return nil
}
func (x *ChartComponent) GetWebsocket() bool {
if x != nil {
return x.Websocket
}
return false
}
var File_components_proto protoreflect.FileDescriptor
var file_components_proto_rawDesc = []byte{
0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x12, 0x08, 0x70, 0x61, 0x6e, 0x6f, 0x70, 0x74, 0x65, 0x73, 0x22, 0x5c, 0x0a, 0x09,
0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2b, 0x0a,
0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x70, 0x61,
0x6e, 0x6f, 0x70, 0x74, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74,
0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3d, 0x0a, 0x06, 0x53, 0x63,
0x68, 0x65, 0x6d, 0x61, 0x12, 0x33, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e,
0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x61, 0x6e, 0x6f, 0x70,
0x74, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x63,
0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x65, 0x0a, 0x0d, 0x54, 0x65, 0x78,
0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e,
0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12,
0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65,
0x78, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x18,
0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74,
0x22, 0x96, 0x01, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e,
0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20,
0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18,
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6c,
0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x61, 0x62,
0x65, 0x6c, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x05, 0x20,
0x03, 0x28, 0x05, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x77,
0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09,
0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2a, 0x24, 0x0a, 0x0d, 0x43, 0x6f, 0x6d,
0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x65,
0x78, 0x74, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x43, 0x68, 0x61, 0x72, 0x74, 0x10, 0x01, 0x42,
0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x2e, 0x6d, 0x61, 0x6c, 0x61, 0x63, 0x68, 0x79, 0x2e, 0x69,
0x65, 0x2f, 0x6d, 0x61, 0x6c, 0x6d, 0x61, 0x6c, 0x32, 0x30, 0x30, 0x2f, 0x70, 0x61, 0x6e, 0x6f,
0x70, 0x74, 0x65, 0x73, 0x2f, 0x73, 0x72, 0x63, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_components_proto_rawDescOnce sync.Once
file_components_proto_rawDescData = file_components_proto_rawDesc
)
func file_components_proto_rawDescGZIP() []byte {
file_components_proto_rawDescOnce.Do(func() {
file_components_proto_rawDescData = protoimpl.X.CompressGZIP(file_components_proto_rawDescData)
})
return file_components_proto_rawDescData
}
var file_components_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_components_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_components_proto_goTypes = []interface{}{
(ComponentType)(0), // 0: panoptes.ComponentType
(*Component)(nil), // 1: panoptes.Component
(*Schema)(nil), // 2: panoptes.Schema
(*TextComponent)(nil), // 3: panoptes.TextComponent
(*ChartComponent)(nil), // 4: panoptes.ChartComponent
}
var file_components_proto_depIdxs = []int32{
0, // 0: panoptes.Component.type:type_name -> panoptes.ComponentType
1, // 1: panoptes.Schema.components:type_name -> panoptes.Component
2, // [2:2] is the sub-list for method output_type
2, // [2:2] 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_components_proto_init() }
func file_components_proto_init() {
if File_components_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_components_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Component); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_components_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Schema); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_components_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TextComponent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_components_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ChartComponent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_components_proto_rawDesc,
NumEnums: 1,
NumMessages: 4,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_components_proto_goTypes,
DependencyIndexes: file_components_proto_depIdxs,
EnumInfos: file_components_proto_enumTypes,
MessageInfos: file_components_proto_msgTypes,
}.Build()
File_components_proto = out.File
file_components_proto_rawDesc = nil
file_components_proto_goTypes = nil
file_components_proto_depIdxs = nil
}

View File

@ -1,10 +0,0 @@
syntax = "proto3";
package panoptes;
option go_package = "git.malachy.ie/malmal200/panoptes/src/common/proto";
message Component {
string name = 1;
int32 id = 2;
optional string text = 3;
}

View File

@ -0,0 +1,35 @@
syntax = "proto3";
package panoptes;
option go_package = "git.malachy.ie/malmal200/panoptes/src/common/proto";
enum ComponentType {
Text = 0;
Chart = 1;
}
message Component {
string id = 1;
string name = 2;
ComponentType type = 3;
}
message Schema {
repeated Component components = 1;
}
message TextComponent {
string name = 1;
int32 id = 2;
string text = 3;
bool websocket = 4;
}
message ChartComponent {
string name = 1;
int32 id = 2;
string type = 3;
repeated string labels = 4;
repeated int32 values = 5;
bool websocket = 6;
}

View File

@ -1,2 +1,2 @@
protoc -I=$(pwd) --go_out=../../backend/pb/ --go_opt=paths=source_relative component.proto protoc -I=$(pwd) --go_out=../../backend/pb/ --go_opt=paths=source_relative components.proto
protoc -I=$(pwd) --csharp_out=../../frontend/pb/ component.proto protoc -I=$(pwd) --csharp_out=../../frontend/pb/ components.proto

View File

@ -1,320 +0,0 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: component.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021, 8981
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Panoptes {
/// <summary>Holder for reflection information generated from component.proto</summary>
public static partial class ComponentReflection {
#region Descriptor
/// <summary>File descriptor for component.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static ComponentReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cg9jb21wb25lbnQucHJvdG8SCHBhbm9wdGVzIkEKCUNvbXBvbmVudBIMCgRu",
"YW1lGAEgASgJEgoKAmlkGAIgASgFEhEKBHRleHQYAyABKAlIAIgBAUIHCgVf",
"dGV4dEI0WjJnaXQubWFsYWNoeS5pZS9tYWxtYWwyMDAvcGFub3B0ZXMvc3Jj",
"L2NvbW1vbi9wcm90b2IGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Panoptes.Component), global::Panoptes.Component.Parser, new[]{ "Name", "Id", "Text" }, new[]{ "Text" }, null, null, null)
}));
}
#endregion
}
#region Messages
public sealed partial class Component : pb::IMessage<Component>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<Component> _parser = new pb::MessageParser<Component>(() => new Component());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<Component> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor {
get { return global::Panoptes.ComponentReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public Component() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public Component(Component other) : this() {
name_ = other.name_;
id_ = other.id_;
text_ = other.text_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public Component Clone() {
return new Component(this);
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "id" field.</summary>
public const int IdFieldNumber = 2;
private int id_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int Id {
get { return id_; }
set {
id_ = value;
}
}
/// <summary>Field number for the "text" field.</summary>
public const int TextFieldNumber = 3;
private string text_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string Text {
get { return text_ ?? ""; }
set {
text_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Gets whether the "text" field is set</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool HasText {
get { return text_ != null; }
}
/// <summary>Clears the value of the "text" field</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void ClearText() {
text_ = null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
return Equals(other as Component);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool Equals(Component other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Name != other.Name) return false;
if (Id != other.Id) return false;
if (Text != other.Text) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode() {
int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (Id != 0) hash ^= Id.GetHashCode();
if (HasText) hash ^= Text.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (Name.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Name);
}
if (Id != 0) {
output.WriteRawTag(16);
output.WriteInt32(Id);
}
if (HasText) {
output.WriteRawTag(26);
output.WriteString(Text);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (Name.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Name);
}
if (Id != 0) {
output.WriteRawTag(16);
output.WriteInt32(Id);
}
if (HasText) {
output.WriteRawTag(26);
output.WriteString(Text);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize() {
int size = 0;
if (Name.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
}
if (Id != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(Id);
}
if (HasText) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Text);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(Component other) {
if (other == null) {
return;
}
if (other.Name.Length != 0) {
Name = other.Name;
}
if (other.Id != 0) {
Id = other.Id;
}
if (other.HasText) {
Text = other.Text;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
Name = input.ReadString();
break;
}
case 16: {
Id = input.ReadInt32();
break;
}
case 26: {
Text = input.ReadString();
break;
}
}
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
Name = input.ReadString();
break;
}
case 16: {
Id = input.ReadInt32();
break;
}
case 26: {
Text = input.ReadString();
break;
}
}
}
}
#endif
}
#endregion
}
#endregion Designer generated code

File diff suppressed because it is too large Load Diff