Merge branch 'backend' into 'master'
Backend API Gateway See merge request murphg62/2023-ca400-murphg62-byrnm257!3
This commit is contained in:
commit
7f56ff09b2
95
src/backend/apiGateway.go
Normal file
95
src/backend/apiGateway.go
Normal file
@ -0,0 +1,95 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"io/ioutil"
|
||||
"github.com/gorilla/mux"
|
||||
)
|
||||
|
||||
type Schema struct {
|
||||
Name string `json:"Name"`
|
||||
Type int `json:"Type"`
|
||||
}
|
||||
|
||||
type Container struct {
|
||||
Id string `json:"Id`
|
||||
Name string `json:"Name"`
|
||||
port string `json:"Port"`
|
||||
}
|
||||
|
||||
var Containers []Container
|
||||
|
||||
func homePage(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprintf(w, "Welcome to the home page!")
|
||||
}
|
||||
|
||||
func getSchema(w http.ResponseWriter, r *http.Request){
|
||||
vars := mux.Vars(r)
|
||||
key := vars["container"]
|
||||
|
||||
for _, container := range Containers {
|
||||
if container.Id == key {
|
||||
requestURL := fmt.Sprintf("http://%s:%s/schema", container.Name, container.port)
|
||||
resp, err := http.Get(requestURL)
|
||||
if err != nil {
|
||||
log.Fatal("Request to container failed: %v", err)
|
||||
}
|
||||
|
||||
defer resp.Body.Close()
|
||||
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
log.Fatal("Failed to print Body: %v", err)
|
||||
}
|
||||
|
||||
fmt.Fprintf(w,string(body))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func getStats(w http.ResponseWriter, r *http.Request){
|
||||
vars := mux.Vars(r)
|
||||
key := vars["container"]
|
||||
|
||||
for _, container := range Containers {
|
||||
if container.Id == key {
|
||||
requestURL := fmt.Sprintf("http://%s:%s/stats", container.Name, container.port)
|
||||
resp, err := http.Get(requestURL)
|
||||
if err != nil {
|
||||
log.Fatal("Request to container failed: %v", err)
|
||||
}
|
||||
|
||||
defer resp.Body.Close()
|
||||
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
log.Fatal("Failed to print Body: %v", err)
|
||||
}
|
||||
|
||||
fmt.Fprintf(w,string(body))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func handleRequests() {
|
||||
myRouter := mux.NewRouter().StrictSlash(true)
|
||||
myRouter.HandleFunc("/", homePage)
|
||||
myRouter.HandleFunc("/{container}/schema", getSchema)
|
||||
myRouter.HandleFunc("/{container}/stats", getStats)
|
||||
|
||||
log.Fatal(http.ListenAndServe(":10000", myRouter))
|
||||
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
Containers = []Container{
|
||||
Container{Id: "1", Name: "localhost", port: "3000"},
|
||||
}
|
||||
|
||||
handleRequests()
|
||||
}
|
||||
@ -1,480 +0,0 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.30.0
|
||||
// protoc v3.21.12
|
||||
// source: components.proto
|
||||
|
||||
package main
|
||||
|
||||
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
|
||||
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,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) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TextComponent) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,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) GetId() int32 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ChartComponent) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
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, 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, 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, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 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, 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,
|
||||
0x20, 0x5a, 0x1e, 0x70, 0x61, 0x6e, 0x6f, 0x70, 0x74, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
|
||||
0x73, 0x72, 0x63, 0x2f, 0x70, 0x61, 0x6e, 0x6f, 0x70, 0x74, 0x65, 0x73, 0x2f, 0x6d, 0x61, 0x69,
|
||||
0x6e, 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
|
||||
}
|
||||
@ -3,11 +3,12 @@ module gitlab.computing.dcu.ie/murphg62/2023-ca400-murphg62-byrnm257/src/backend
|
||||
go 1.19
|
||||
|
||||
require (
|
||||
github.com/golang/protobuf v1.5.2 // indirect
|
||||
github.com/golang/protobuf v1.5.3 // indirect
|
||||
github.com/gorilla/mux v1.8.0 // indirect
|
||||
golang.org/x/net v0.8.0 // indirect
|
||||
golang.org/x/sys v0.6.0 // indirect
|
||||
golang.org/x/text v0.8.0 // indirect
|
||||
google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect
|
||||
google.golang.org/grpc v1.53.0 // indirect
|
||||
google.golang.org/protobuf v1.28.1 // indirect
|
||||
google.golang.org/protobuf v1.30.0 // indirect
|
||||
)
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
|
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
||||
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
|
||||
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
|
||||
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.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
|
||||
@ -27,3 +31,5 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0
|
||||
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/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
|
||||
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
|
||||
@ -8,6 +8,11 @@ enum ComponentType {
|
||||
Chart = 1;
|
||||
}
|
||||
|
||||
message Container {
|
||||
string name = 1;
|
||||
string port = 2;
|
||||
}
|
||||
|
||||
message Component {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user