diff --git a/README.md b/README.md index 615e2c8..70984ab 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ # backend-protobuf -Definitions of protobufs used in Beep backend +Definitions of [protobufs](https://developers.google.com/protocol-buffers) used in Beep backend. + +### Bite (bite.proto) + +```proto +message Bite { + bytes key = 1; + uint64 start = 2; + bytes data = 3; +} +``` diff --git a/bite.pb.go b/bite.pb.go new file mode 100644 index 0000000..cdc67b5 --- /dev/null +++ b/bite.pb.go @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: bite.proto + +package main + +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + 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 Bite struct { + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Start uint64 `protobuf:"varint,2,opt,name=start,proto3" json:"start,omitempty"` + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Bite) Reset() { *m = Bite{} } +func (m *Bite) String() string { return proto.CompactTextString(m) } +func (*Bite) ProtoMessage() {} +func (*Bite) Descriptor() ([]byte, []int) { + return fileDescriptor_e1ec993646b17549, []int{0} +} + +func (m *Bite) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Bite.Unmarshal(m, b) +} +func (m *Bite) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Bite.Marshal(b, m, deterministic) +} +func (m *Bite) XXX_Merge(src proto.Message) { + xxx_messageInfo_Bite.Merge(m, src) +} +func (m *Bite) XXX_Size() int { + return xxx_messageInfo_Bite.Size(m) +} +func (m *Bite) XXX_DiscardUnknown() { + xxx_messageInfo_Bite.DiscardUnknown(m) +} + +var xxx_messageInfo_Bite proto.InternalMessageInfo + +func (m *Bite) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +func (m *Bite) GetStart() uint64 { + if m != nil { + return m.Start + } + return 0 +} + +func (m *Bite) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +func init() { + proto.RegisterType((*Bite)(nil), "main.Bite") +} + +func init() { proto.RegisterFile("bite.proto", fileDescriptor_e1ec993646b17549) } + +var fileDescriptor_e1ec993646b17549 = []byte{ + // 102 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4a, 0xca, 0x2c, 0x49, + 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0xc9, 0x4d, 0xcc, 0xcc, 0x53, 0x72, 0xe2, 0x62, + 0x71, 0xca, 0x2c, 0x49, 0x15, 0x12, 0xe0, 0x62, 0xce, 0x4e, 0xad, 0x94, 0x60, 0x54, 0x60, 0xd4, + 0xe0, 0x09, 0x02, 0x31, 0x85, 0x44, 0xb8, 0x58, 0x8b, 0x4b, 0x12, 0x8b, 0x4a, 0x24, 0x98, 0x14, + 0x18, 0x35, 0x58, 0x82, 0x20, 0x1c, 0x21, 0x21, 0x2e, 0x96, 0x94, 0xc4, 0x92, 0x44, 0x09, 0x66, + 0xb0, 0x42, 0x30, 0x3b, 0x89, 0x0d, 0x6c, 0xa0, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xa3, 0xe1, + 0xe5, 0xfe, 0x5e, 0x00, 0x00, 0x00, +} diff --git a/bite.proto b/bite.proto new file mode 100644 index 0000000..7c4523c --- /dev/null +++ b/bite.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; +package main; + +message Bite { + bytes key = 1; + uint64 start = 2; + bytes data = 3; +}