diff --git a/datalogger_pb/datalogger.pb.go b/datalogger_pb/datalogger.pb.go new file mode 100644 index 0000000..8b8e97e --- /dev/null +++ b/datalogger_pb/datalogger.pb.go @@ -0,0 +1,111 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: datalogger.proto + +/* +Package datalogger_pb is a generated protocol buffer package. + +It is generated from these files: + datalogger.proto + +It has these top-level messages: + Devices + Device +*/ +package datalogger_pb + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +// A structure containing all the devices listed in the network repo. +type Devices struct { + Devices map[string]*Device `protobuf:"bytes,1,rep,name=devices" json:"devices,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *Devices) Reset() { *m = Devices{} } +func (m *Devices) String() string { return proto.CompactTextString(m) } +func (*Devices) ProtoMessage() {} +func (*Devices) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Devices) GetDevices() map[string]*Device { + if m != nil { + return m.Devices + } + return nil +} + +type Device struct { + Hostname string `protobuf:"bytes,1,opt,name=hostname" json:"hostname,omitempty"` + Ipaddr string `protobuf:"bytes,2,opt,name=ipaddr" json:"ipaddr,omitempty"` + Model string `protobuf:"bytes,3,opt,name=model" json:"model,omitempty"` + Tags []string `protobuf:"bytes,4,rep,name=tags" json:"tags,omitempty"` +} + +func (m *Device) Reset() { *m = Device{} } +func (m *Device) String() string { return proto.CompactTextString(m) } +func (*Device) ProtoMessage() {} +func (*Device) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *Device) GetHostname() string { + if m != nil { + return m.Hostname + } + return "" +} + +func (m *Device) GetIpaddr() string { + if m != nil { + return m.Ipaddr + } + return "" +} + +func (m *Device) GetModel() string { + if m != nil { + return m.Model + } + return "" +} + +func (m *Device) GetTags() []string { + if m != nil { + return m.Tags + } + return nil +} + +func init() { + proto.RegisterType((*Devices)(nil), "datalogger.Devices") + proto.RegisterType((*Device)(nil), "datalogger.Device") +} + +func init() { proto.RegisterFile("datalogger.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 219 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x48, 0x49, 0x2c, 0x49, + 0xcc, 0xc9, 0x4f, 0x4f, 0x4f, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x42, 0x88, + 0x28, 0x4d, 0x65, 0xe4, 0x62, 0x77, 0x49, 0x2d, 0xcb, 0x4c, 0x4e, 0x2d, 0x16, 0xb2, 0xe2, 0x62, + 0x4f, 0x81, 0x30, 0x25, 0x18, 0x15, 0x98, 0x35, 0xb8, 0x8d, 0x14, 0xf4, 0x90, 0xf4, 0x42, 0x55, + 0xc1, 0x68, 0xd7, 0xbc, 0x92, 0xa2, 0xca, 0x20, 0x98, 0x06, 0x29, 0x3f, 0x2e, 0x1e, 0x64, 0x09, + 0x21, 0x01, 0x2e, 0xe6, 0xec, 0xd4, 0x4a, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x10, 0x53, + 0x48, 0x83, 0x8b, 0xb5, 0x2c, 0x31, 0xa7, 0x34, 0x55, 0x82, 0x49, 0x81, 0x51, 0x83, 0xdb, 0x48, + 0x08, 0xd3, 0xec, 0x20, 0x88, 0x02, 0x2b, 0x26, 0x0b, 0x46, 0xa5, 0x34, 0x2e, 0x36, 0x88, 0xa0, + 0x90, 0x14, 0x17, 0x47, 0x46, 0x7e, 0x71, 0x49, 0x5e, 0x62, 0x6e, 0x2a, 0xd4, 0x38, 0x38, 0x5f, + 0x48, 0x8c, 0x8b, 0x2d, 0xb3, 0x20, 0x31, 0x25, 0xa5, 0x08, 0x6c, 0x28, 0x67, 0x10, 0x94, 0x27, + 0x24, 0xc2, 0xc5, 0x9a, 0x9b, 0x9f, 0x92, 0x9a, 0x23, 0xc1, 0x0c, 0x16, 0x86, 0x70, 0x84, 0x84, + 0xb8, 0x58, 0x4a, 0x12, 0xd3, 0x8b, 0x25, 0x58, 0x14, 0x98, 0x35, 0x38, 0x83, 0xc0, 0x6c, 0x27, + 0xfe, 0x28, 0x5e, 0x84, 0x3b, 0xe2, 0x0b, 0x92, 0x92, 0xd8, 0xc0, 0x61, 0x64, 0x0c, 0x08, 0x00, + 0x00, 0xff, 0xff, 0x32, 0x0b, 0x12, 0x78, 0x37, 0x01, 0x00, 0x00, +} diff --git a/protobuf/datalogger/datalogger.proto b/protobuf/datalogger/datalogger.proto new file mode 100644 index 0000000..421c4e9 --- /dev/null +++ b/protobuf/datalogger/datalogger.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +// protoc --proto_path=protobuf/datalogger --go_out=datalogger_pb protobuf/datalogger/datalogger.proto + +package datalogger; +option go_package = "datalogger_pb"; + +//A structure containing all the devices listed in the network repo. +message Devices { + map devices = 1; +} + +message Device { + string hostname = 1; + string ipaddr = 2; + string model = 3; + repeated string tags = 4; +} \ No newline at end of file