Cleanup & refactor protobuf codegen

This commit is contained in:
Denis Arh
2020-02-26 08:20:59 +01:00
parent c34814b855
commit d2fcb352ec
11 changed files with 14 additions and 1085 deletions
-39
View File
@@ -1,39 +0,0 @@
package proto
import (
"github.com/cortezaproject/corteza-server/compose/types"
)
func FromModule(i *types.Module) *Module {
if i == nil {
return nil
}
var p = &Module{
ModuleID: i.ID,
NamespaceID: i.NamespaceID,
Name: i.Name,
CreatedAt: fromTime(i.CreatedAt),
UpdatedAt: fromTime(i.UpdatedAt),
DeletedAt: fromTime(i.DeletedAt),
Fields: make([]*ModuleField, len(i.Fields)),
}
for f := range i.Fields {
p.Fields[f] = &ModuleField{
FieldID: i.Fields[f].ID,
Name: i.Fields[f].Name,
Kind: i.Fields[f].Kind,
IsMulti: i.Fields[f].Multi,
IsPrivate: i.Fields[f].Private,
IsVisible: i.Fields[f].Visible,
IsRequired: i.Fields[f].Required,
// @todo add default value
// @todo add options
}
}
return p
}
-227
View File
@@ -1,227 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: module.proto
package proto
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
timestamp "github.com/golang/protobuf/ptypes/timestamp"
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.ProtoPackageIsVersion3 // please upgrade the proto package
type Module struct {
ModuleID uint64 `protobuf:"varint,1,opt,name=moduleID,proto3" json:"moduleID,omitempty"`
NamespaceID uint64 `protobuf:"varint,2,opt,name=namespaceID,proto3" json:"namespaceID,omitempty"`
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
CreatedAt *timestamp.Timestamp `protobuf:"bytes,8,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
UpdatedAt *timestamp.Timestamp `protobuf:"bytes,9,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"`
DeletedAt *timestamp.Timestamp `protobuf:"bytes,10,opt,name=deletedAt,proto3" json:"deletedAt,omitempty"`
Fields []*ModuleField `protobuf:"bytes,15,rep,name=fields,proto3" json:"fields,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Module) Reset() { *m = Module{} }
func (m *Module) String() string { return proto.CompactTextString(m) }
func (*Module) ProtoMessage() {}
func (*Module) Descriptor() ([]byte, []int) {
return fileDescriptor_ae7704718fb7daeb, []int{0}
}
func (m *Module) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Module.Unmarshal(m, b)
}
func (m *Module) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Module.Marshal(b, m, deterministic)
}
func (m *Module) XXX_Merge(src proto.Message) {
xxx_messageInfo_Module.Merge(m, src)
}
func (m *Module) XXX_Size() int {
return xxx_messageInfo_Module.Size(m)
}
func (m *Module) XXX_DiscardUnknown() {
xxx_messageInfo_Module.DiscardUnknown(m)
}
var xxx_messageInfo_Module proto.InternalMessageInfo
func (m *Module) GetModuleID() uint64 {
if m != nil {
return m.ModuleID
}
return 0
}
func (m *Module) GetNamespaceID() uint64 {
if m != nil {
return m.NamespaceID
}
return 0
}
func (m *Module) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *Module) GetCreatedAt() *timestamp.Timestamp {
if m != nil {
return m.CreatedAt
}
return nil
}
func (m *Module) GetUpdatedAt() *timestamp.Timestamp {
if m != nil {
return m.UpdatedAt
}
return nil
}
func (m *Module) GetDeletedAt() *timestamp.Timestamp {
if m != nil {
return m.DeletedAt
}
return nil
}
func (m *Module) GetFields() []*ModuleField {
if m != nil {
return m.Fields
}
return nil
}
type ModuleField struct {
FieldID uint64 `protobuf:"varint,1,opt,name=fieldID,proto3" json:"fieldID,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Kind string `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"`
IsMulti bool `protobuf:"varint,4,opt,name=isMulti,proto3" json:"isMulti,omitempty"`
IsPrivate bool `protobuf:"varint,5,opt,name=isPrivate,proto3" json:"isPrivate,omitempty"`
IsVisible bool `protobuf:"varint,6,opt,name=isVisible,proto3" json:"isVisible,omitempty"`
IsRequired bool `protobuf:"varint,7,opt,name=isRequired,proto3" json:"isRequired,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ModuleField) Reset() { *m = ModuleField{} }
func (m *ModuleField) String() string { return proto.CompactTextString(m) }
func (*ModuleField) ProtoMessage() {}
func (*ModuleField) Descriptor() ([]byte, []int) {
return fileDescriptor_ae7704718fb7daeb, []int{1}
}
func (m *ModuleField) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ModuleField.Unmarshal(m, b)
}
func (m *ModuleField) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ModuleField.Marshal(b, m, deterministic)
}
func (m *ModuleField) XXX_Merge(src proto.Message) {
xxx_messageInfo_ModuleField.Merge(m, src)
}
func (m *ModuleField) XXX_Size() int {
return xxx_messageInfo_ModuleField.Size(m)
}
func (m *ModuleField) XXX_DiscardUnknown() {
xxx_messageInfo_ModuleField.DiscardUnknown(m)
}
var xxx_messageInfo_ModuleField proto.InternalMessageInfo
func (m *ModuleField) GetFieldID() uint64 {
if m != nil {
return m.FieldID
}
return 0
}
func (m *ModuleField) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *ModuleField) GetKind() string {
if m != nil {
return m.Kind
}
return ""
}
func (m *ModuleField) GetIsMulti() bool {
if m != nil {
return m.IsMulti
}
return false
}
func (m *ModuleField) GetIsPrivate() bool {
if m != nil {
return m.IsPrivate
}
return false
}
func (m *ModuleField) GetIsVisible() bool {
if m != nil {
return m.IsVisible
}
return false
}
func (m *ModuleField) GetIsRequired() bool {
if m != nil {
return m.IsRequired
}
return false
}
func init() {
proto.RegisterType((*Module)(nil), "compose.Module")
proto.RegisterType((*ModuleField)(nil), "compose.ModuleField")
}
func init() { proto.RegisterFile("module.proto", fileDescriptor_ae7704718fb7daeb) }
var fileDescriptor_ae7704718fb7daeb = []byte{
// 317 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x90, 0xc1, 0x4b, 0xc3, 0x30,
0x14, 0xc6, 0xe9, 0xd6, 0xb5, 0xeb, 0xab, 0x20, 0x04, 0x0f, 0x61, 0x88, 0x96, 0x9d, 0x7a, 0x90,
0x0e, 0xe6, 0xc5, 0xab, 0x22, 0x82, 0x87, 0x81, 0x14, 0xf1, 0xe0, 0xad, 0x5b, 0xde, 0x46, 0x30,
0x5d, 0x6a, 0x93, 0xfa, 0xa7, 0xf9, 0x1f, 0xf8, 0x7f, 0x49, 0x92, 0xa6, 0xeb, 0x6d, 0xa7, 0xe4,
0x7d, 0xbf, 0xef, 0x7b, 0x3c, 0x3e, 0xb8, 0xa8, 0x25, 0xeb, 0x04, 0x16, 0x4d, 0x2b, 0xb5, 0x24,
0xf1, 0x4e, 0xd6, 0x8d, 0x54, 0xb8, 0xb8, 0x3d, 0x48, 0x79, 0x10, 0xb8, 0xb2, 0xf2, 0xb6, 0xdb,
0xaf, 0x34, 0xaf, 0x51, 0xe9, 0xaa, 0x6e, 0x9c, 0x73, 0xf9, 0x3b, 0x81, 0x68, 0x63, 0xa3, 0x64,
0x01, 0x73, 0xb7, 0xe4, 0xf5, 0x99, 0x06, 0x59, 0x90, 0x87, 0xe5, 0x30, 0x93, 0x0c, 0xd2, 0x63,
0x55, 0xa3, 0x6a, 0xaa, 0x9d, 0xc1, 0x13, 0x8b, 0xc7, 0x12, 0x21, 0x10, 0x9a, 0x91, 0x4e, 0xb3,
0x20, 0x4f, 0x4a, 0xfb, 0x27, 0x0f, 0x90, 0xec, 0x5a, 0xac, 0x34, 0xb2, 0x47, 0x4d, 0xe7, 0x59,
0x90, 0xa7, 0xeb, 0x45, 0xe1, 0x2e, 0x2a, 0xfc, 0x45, 0xc5, 0xbb, 0xbf, 0xa8, 0x3c, 0x99, 0x4d,
0xb2, 0x6b, 0x58, 0x9f, 0x4c, 0xce, 0x27, 0x07, 0xb3, 0x49, 0x32, 0x14, 0xe8, 0x92, 0x70, 0x3e,
0x39, 0x98, 0xc9, 0x1d, 0x44, 0x7b, 0x8e, 0x82, 0x29, 0x7a, 0x99, 0x4d, 0xf3, 0x74, 0x7d, 0x55,
0xf4, 0x2d, 0x16, 0xae, 0xa0, 0x17, 0x03, 0xcb, 0xde, 0xb3, 0xfc, 0x0b, 0x20, 0x1d, 0xe9, 0x84,
0x42, 0x6c, 0xc9, 0x50, 0x9e, 0x1f, 0x87, 0x66, 0x26, 0xa3, 0x66, 0x08, 0x84, 0x5f, 0xfc, 0xc8,
0x7c, 0x5b, 0xe6, 0x6f, 0x36, 0x70, 0xb5, 0xe9, 0x84, 0xe6, 0x34, 0xcc, 0x82, 0x7c, 0x5e, 0xfa,
0x91, 0x5c, 0x43, 0xc2, 0xd5, 0x5b, 0xcb, 0x7f, 0x2a, 0x8d, 0x74, 0x66, 0xd9, 0x49, 0x70, 0xf4,
0x83, 0x2b, 0xbe, 0x15, 0x48, 0x23, 0x4f, 0x7b, 0x81, 0xdc, 0x00, 0x70, 0x55, 0xe2, 0x77, 0xc7,
0x5b, 0x64, 0x34, 0xb6, 0x78, 0xa4, 0x3c, 0xc5, 0x9f, 0x33, 0x57, 0x4b, 0x64, 0x9f, 0xfb, 0xff,
0x00, 0x00, 0x00, 0xff, 0xff, 0xb3, 0x5f, 0x7a, 0xe9, 0x4a, 0x02, 0x00, 0x00,
}
-23
View File
@@ -1,23 +0,0 @@
package proto
import (
"github.com/cortezaproject/corteza-server/compose/types"
)
func FromNamespace(i *types.Namespace) *Namespace {
if i == nil {
return nil
}
var p = &Namespace{
NamespaceID: i.ID,
Name: i.Name,
Slug: i.Slug,
Enabled: i.Enabled,
CreatedAt: fromTime(i.CreatedAt),
UpdatedAt: fromTime(i.UpdatedAt),
DeletedAt: fromTime(i.DeletedAt),
}
return p
}
-133
View File
@@ -1,133 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: namespace.proto
package proto
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
timestamp "github.com/golang/protobuf/ptypes/timestamp"
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.ProtoPackageIsVersion3 // please upgrade the proto package
type Namespace struct {
NamespaceID uint64 `protobuf:"varint,1,opt,name=namespaceID,proto3" json:"namespaceID,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Slug string `protobuf:"bytes,3,opt,name=slug,proto3" json:"slug,omitempty"`
Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"`
CreatedAt *timestamp.Timestamp `protobuf:"bytes,8,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
UpdatedAt *timestamp.Timestamp `protobuf:"bytes,9,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"`
DeletedAt *timestamp.Timestamp `protobuf:"bytes,10,opt,name=deletedAt,proto3" json:"deletedAt,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Namespace) Reset() { *m = Namespace{} }
func (m *Namespace) String() string { return proto.CompactTextString(m) }
func (*Namespace) ProtoMessage() {}
func (*Namespace) Descriptor() ([]byte, []int) {
return fileDescriptor_ecb1e126f615f5dd, []int{0}
}
func (m *Namespace) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Namespace.Unmarshal(m, b)
}
func (m *Namespace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Namespace.Marshal(b, m, deterministic)
}
func (m *Namespace) XXX_Merge(src proto.Message) {
xxx_messageInfo_Namespace.Merge(m, src)
}
func (m *Namespace) XXX_Size() int {
return xxx_messageInfo_Namespace.Size(m)
}
func (m *Namespace) XXX_DiscardUnknown() {
xxx_messageInfo_Namespace.DiscardUnknown(m)
}
var xxx_messageInfo_Namespace proto.InternalMessageInfo
func (m *Namespace) GetNamespaceID() uint64 {
if m != nil {
return m.NamespaceID
}
return 0
}
func (m *Namespace) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *Namespace) GetSlug() string {
if m != nil {
return m.Slug
}
return ""
}
func (m *Namespace) GetEnabled() bool {
if m != nil {
return m.Enabled
}
return false
}
func (m *Namespace) GetCreatedAt() *timestamp.Timestamp {
if m != nil {
return m.CreatedAt
}
return nil
}
func (m *Namespace) GetUpdatedAt() *timestamp.Timestamp {
if m != nil {
return m.UpdatedAt
}
return nil
}
func (m *Namespace) GetDeletedAt() *timestamp.Timestamp {
if m != nil {
return m.DeletedAt
}
return nil
}
func init() {
proto.RegisterType((*Namespace)(nil), "compose.Namespace")
}
func init() { proto.RegisterFile("namespace.proto", fileDescriptor_ecb1e126f615f5dd) }
var fileDescriptor_ecb1e126f615f5dd = []byte{
// 213 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x8e, 0x31, 0x4f, 0xc4, 0x20,
0x18, 0x86, 0xc3, 0x59, 0xed, 0xc1, 0x0d, 0x26, 0x4c, 0xe4, 0x16, 0x89, 0x13, 0x13, 0x4d, 0x74,
0x71, 0xd5, 0xb8, 0xb8, 0x38, 0x10, 0x27, 0x37, 0x5a, 0x3e, 0x1b, 0x13, 0x28, 0xa4, 0xd0, 0x9f,
0xe3, 0x7f, 0x35, 0x14, 0xa9, 0xb7, 0x75, 0xe2, 0x7b, 0xdf, 0x3c, 0x0f, 0x79, 0xc9, 0xed, 0xa4,
0x1d, 0xc4, 0xa0, 0x07, 0x90, 0x61, 0xf6, 0xc9, 0xd3, 0x76, 0xf0, 0x2e, 0xf8, 0x08, 0xe7, 0xbb,
0xd1, 0xfb, 0xd1, 0x42, 0xb7, 0xd6, 0xfd, 0xf2, 0xd5, 0xa5, 0x6f, 0x07, 0x31, 0x69, 0x17, 0x0a,
0x79, 0xff, 0x73, 0x20, 0xf8, 0xbd, 0xda, 0x94, 0x93, 0xd3, 0xf6, 0xd5, 0xdb, 0x2b, 0x43, 0x1c,
0x89, 0x46, 0x5d, 0x56, 0x94, 0x92, 0x26, 0x47, 0x76, 0xe0, 0x48, 0x60, 0xb5, 0xde, 0xb9, 0x8b,
0x76, 0x19, 0xd9, 0x55, 0xe9, 0xf2, 0x4d, 0x19, 0x69, 0x61, 0xd2, 0xbd, 0x05, 0xc3, 0x1a, 0x8e,
0xc4, 0x51, 0xd5, 0x48, 0x9f, 0x08, 0x1e, 0x66, 0xd0, 0x09, 0xcc, 0x73, 0x62, 0x47, 0x8e, 0xc4,
0xe9, 0xe1, 0x2c, 0xcb, 0x4c, 0x59, 0x67, 0xca, 0x8f, 0x3a, 0x53, 0xfd, 0xc3, 0xd9, 0x5c, 0x82,
0xf9, 0x33, 0xf1, 0xbe, 0xb9, 0xc1, 0xd9, 0x34, 0x60, 0xa1, 0x98, 0x64, 0xdf, 0xdc, 0xe0, 0x97,
0xf6, 0xf3, 0xba, 0x00, 0x37, 0xeb, 0xf3, 0xf8, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xb4, 0x34, 0xc5,
0xd1, 0x6c, 0x01, 0x00, 0x00,
}
-80
View File
@@ -1,80 +0,0 @@
package proto
import (
"time"
"github.com/golang/protobuf/ptypes/timestamp"
"github.com/cortezaproject/corteza-server/compose/types"
)
func ToRecord(i *Record) *types.Record {
if i == nil {
return nil
}
var t = &types.Record{
ID: i.RecordID,
ModuleID: i.ModuleID,
NamespaceID: i.NamespaceID,
OwnedBy: i.OwnedBy,
CreatedBy: i.CreatedBy,
UpdatedBy: i.UpdatedBy,
DeletedBy: i.DeletedBy,
CreatedAt: toTime(i.CreatedAt),
UpdatedAt: toTimePtr(i.UpdatedAt),
DeletedAt: toTimePtr(i.DeletedAt),
Values: make([]*types.RecordValue, len(i.Values)),
}
for v := range i.Values {
t.Values[v] = &types.RecordValue{
Value: i.Values[v].Value,
Name: i.Values[v].Name,
}
}
return t
}
// Converts time.Time (ptr AND value) to *timestamp.Timestamp
//
// Intentionally ignoring
func toTime(ts *timestamp.Timestamp) time.Time {
var t = time.Time{}
return t.Add(time.Duration(ts.GetNanos()) + (time.Duration(ts.GetSeconds()) * time.Second))
}
func toTimePtr(ts *timestamp.Timestamp) *time.Time {
var t = toTime(ts)
return &t
}
func FromRecord(i *types.Record) *Record {
if i == nil {
return nil
}
var p = &Record{
RecordID: i.ID,
ModuleID: i.ModuleID,
NamespaceID: i.NamespaceID,
OwnedBy: i.OwnedBy,
CreatedBy: i.CreatedBy,
UpdatedBy: i.UpdatedBy,
DeletedBy: i.DeletedBy,
CreatedAt: fromTime(i.CreatedAt),
UpdatedAt: fromTime(i.UpdatedAt),
DeletedAt: fromTime(i.DeletedAt),
Values: make([]*RecordValue, len(i.Values)),
}
for v := range i.Values {
p.Values[v] = &RecordValue{
Value: i.Values[v].Value,
Name: i.Values[v].Name,
}
}
return p
}
-218
View File
@@ -1,218 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: record.proto
package proto
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
timestamp "github.com/golang/protobuf/ptypes/timestamp"
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.ProtoPackageIsVersion3 // please upgrade the proto package
type Record struct {
RecordID uint64 `protobuf:"varint,1,opt,name=recordID,proto3" json:"recordID,omitempty"`
ModuleID uint64 `protobuf:"varint,2,opt,name=moduleID,proto3" json:"moduleID,omitempty"`
NamespaceID uint64 `protobuf:"varint,3,opt,name=namespaceID,proto3" json:"namespaceID,omitempty"`
OwnedBy uint64 `protobuf:"varint,4,opt,name=ownedBy,proto3" json:"ownedBy,omitempty"`
CreatedBy uint64 `protobuf:"varint,5,opt,name=createdBy,proto3" json:"createdBy,omitempty"`
UpdatedBy uint64 `protobuf:"varint,6,opt,name=updatedBy,proto3" json:"updatedBy,omitempty"`
DeletedBy uint64 `protobuf:"varint,7,opt,name=deletedBy,proto3" json:"deletedBy,omitempty"`
CreatedAt *timestamp.Timestamp `protobuf:"bytes,8,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
UpdatedAt *timestamp.Timestamp `protobuf:"bytes,9,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"`
DeletedAt *timestamp.Timestamp `protobuf:"bytes,10,opt,name=deletedAt,proto3" json:"deletedAt,omitempty"`
Values []*RecordValue `protobuf:"bytes,15,rep,name=values,proto3" json:"values,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Record) Reset() { *m = Record{} }
func (m *Record) String() string { return proto.CompactTextString(m) }
func (*Record) ProtoMessage() {}
func (*Record) Descriptor() ([]byte, []int) {
return fileDescriptor_bf94fd919e302a1d, []int{0}
}
func (m *Record) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Record.Unmarshal(m, b)
}
func (m *Record) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Record.Marshal(b, m, deterministic)
}
func (m *Record) XXX_Merge(src proto.Message) {
xxx_messageInfo_Record.Merge(m, src)
}
func (m *Record) XXX_Size() int {
return xxx_messageInfo_Record.Size(m)
}
func (m *Record) XXX_DiscardUnknown() {
xxx_messageInfo_Record.DiscardUnknown(m)
}
var xxx_messageInfo_Record proto.InternalMessageInfo
func (m *Record) GetRecordID() uint64 {
if m != nil {
return m.RecordID
}
return 0
}
func (m *Record) GetModuleID() uint64 {
if m != nil {
return m.ModuleID
}
return 0
}
func (m *Record) GetNamespaceID() uint64 {
if m != nil {
return m.NamespaceID
}
return 0
}
func (m *Record) GetOwnedBy() uint64 {
if m != nil {
return m.OwnedBy
}
return 0
}
func (m *Record) GetCreatedBy() uint64 {
if m != nil {
return m.CreatedBy
}
return 0
}
func (m *Record) GetUpdatedBy() uint64 {
if m != nil {
return m.UpdatedBy
}
return 0
}
func (m *Record) GetDeletedBy() uint64 {
if m != nil {
return m.DeletedBy
}
return 0
}
func (m *Record) GetCreatedAt() *timestamp.Timestamp {
if m != nil {
return m.CreatedAt
}
return nil
}
func (m *Record) GetUpdatedAt() *timestamp.Timestamp {
if m != nil {
return m.UpdatedAt
}
return nil
}
func (m *Record) GetDeletedAt() *timestamp.Timestamp {
if m != nil {
return m.DeletedAt
}
return nil
}
func (m *Record) GetValues() []*RecordValue {
if m != nil {
return m.Values
}
return nil
}
type RecordValue struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *RecordValue) Reset() { *m = RecordValue{} }
func (m *RecordValue) String() string { return proto.CompactTextString(m) }
func (*RecordValue) ProtoMessage() {}
func (*RecordValue) Descriptor() ([]byte, []int) {
return fileDescriptor_bf94fd919e302a1d, []int{1}
}
func (m *RecordValue) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RecordValue.Unmarshal(m, b)
}
func (m *RecordValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_RecordValue.Marshal(b, m, deterministic)
}
func (m *RecordValue) XXX_Merge(src proto.Message) {
xxx_messageInfo_RecordValue.Merge(m, src)
}
func (m *RecordValue) XXX_Size() int {
return xxx_messageInfo_RecordValue.Size(m)
}
func (m *RecordValue) XXX_DiscardUnknown() {
xxx_messageInfo_RecordValue.DiscardUnknown(m)
}
var xxx_messageInfo_RecordValue proto.InternalMessageInfo
func (m *RecordValue) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *RecordValue) GetValue() string {
if m != nil {
return m.Value
}
return ""
}
func init() {
proto.RegisterType((*Record)(nil), "compose.Record")
proto.RegisterType((*RecordValue)(nil), "compose.RecordValue")
}
func init() { proto.RegisterFile("record.proto", fileDescriptor_bf94fd919e302a1d) }
var fileDescriptor_bf94fd919e302a1d = []byte{
// 297 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x91, 0x3f, 0x6b, 0xc3, 0x30,
0x10, 0xc5, 0x49, 0xfd, 0x2f, 0x3e, 0x17, 0x0a, 0x22, 0x83, 0x30, 0x85, 0x9a, 0x4c, 0x1e, 0x8a,
0x02, 0xe9, 0xd0, 0xae, 0x0e, 0x59, 0xb2, 0x8a, 0xd2, 0xa1, 0x9b, 0x6b, 0x5f, 0x43, 0xc1, 0x8e,
0x8c, 0x2d, 0xb7, 0xf4, 0x6b, 0xf5, 0x13, 0x16, 0x9d, 0x6c, 0x25, 0x5b, 0x26, 0xfb, 0xde, 0xef,
0x3d, 0x49, 0xdc, 0x83, 0xdb, 0x1e, 0x2b, 0xd5, 0xd7, 0xa2, 0xeb, 0x95, 0x56, 0x2c, 0xaa, 0x54,
0xdb, 0xa9, 0x01, 0xd3, 0x87, 0xa3, 0x52, 0xc7, 0x06, 0x37, 0x24, 0x7f, 0x8c, 0x9f, 0x1b, 0xfd,
0xd5, 0xe2, 0xa0, 0xcb, 0xb6, 0xb3, 0xce, 0xf5, 0x9f, 0x07, 0xa1, 0xa4, 0x28, 0x4b, 0x61, 0x69,
0x0f, 0x39, 0xec, 0xf9, 0x22, 0x5b, 0xe4, 0xbe, 0x74, 0xb3, 0x61, 0xad, 0xaa, 0xc7, 0x06, 0x0f,
0x7b, 0x7e, 0x63, 0xd9, 0x3c, 0xb3, 0x0c, 0x92, 0x53, 0xd9, 0xe2, 0xd0, 0x95, 0x95, 0xc1, 0x1e,
0xe1, 0x4b, 0x89, 0x71, 0x88, 0xd4, 0xcf, 0x09, 0xeb, 0xdd, 0x2f, 0xf7, 0x89, 0xce, 0x23, 0xbb,
0x87, 0xb8, 0xea, 0xb1, 0xd4, 0xc4, 0x02, 0x62, 0x67, 0xc1, 0xd0, 0xb1, 0xab, 0x27, 0x1a, 0x5a,
0xea, 0x04, 0x43, 0x6b, 0x6c, 0xd0, 0xd2, 0xc8, 0x52, 0x27, 0xb0, 0x17, 0x77, 0x72, 0xa1, 0xf9,
0x32, 0x5b, 0xe4, 0xc9, 0x36, 0x15, 0x76, 0x1b, 0x62, 0xde, 0x86, 0x78, 0x9d, 0xb7, 0x21, 0xcf,
0x66, 0x93, 0x9c, 0x2e, 0x29, 0x34, 0x8f, 0xaf, 0x27, 0x9d, 0xd9, 0x24, 0xa7, 0x07, 0x14, 0x9a,
0xc3, 0xf5, 0xa4, 0x33, 0xb3, 0x47, 0x08, 0xbf, 0xcb, 0x66, 0xc4, 0x81, 0xdf, 0x65, 0x5e, 0x9e,
0x6c, 0x57, 0x62, 0x6a, 0x50, 0xd8, 0x72, 0xde, 0x0c, 0x94, 0x93, 0x67, 0xfd, 0x0c, 0xc9, 0x85,
0xcc, 0x18, 0xf8, 0x66, 0xdb, 0x54, 0x5a, 0x2c, 0xe9, 0x9f, 0xad, 0x20, 0x20, 0x33, 0xb5, 0x15,
0x4b, 0x3b, 0xec, 0xa2, 0xf7, 0xc0, 0xbe, 0x23, 0xa4, 0xcf, 0xd3, 0x7f, 0x00, 0x00, 0x00, 0xff,
0xff, 0xbf, 0x75, 0x72, 0x13, 0x37, 0x02, 0x00, 0x00,
}
-24
View File
@@ -1,24 +0,0 @@
package proto
import (
"time"
"github.com/golang/protobuf/ptypes/timestamp"
)
// Converts time.Time (ptr AND value) to *timestamp.Timestamp
//
// Intentionally ignoring
func fromTime(i interface{}) *timestamp.Timestamp {
switch t := i.(type) {
case *time.Time:
if t == nil {
return nil
}
return &timestamp.Timestamp{Seconds: t.Unix(), Nanos: int32(t.Nanosecond())}
case time.Time:
return &timestamp.Timestamp{Seconds: t.Unix(), Nanos: int32(t.Nanosecond())}
default:
return nil
}
}