781 lines
16 KiB
Go
781 lines
16 KiB
Go
// Code generated by protoc-gen-gogo.
|
|
// source: serializations.proto
|
|
// DO NOT EDIT!
|
|
|
|
/*
|
|
Package proto is a generated protocol buffer package.
|
|
|
|
It is generated from these files:
|
|
serializations.proto
|
|
|
|
It has these top-level messages:
|
|
LogDelta
|
|
HistoryEntry
|
|
NodeData
|
|
Quad
|
|
*/
|
|
package proto
|
|
|
|
import proto1 "github.com/gogo/protobuf/proto"
|
|
|
|
import io "io"
|
|
import fmt "fmt"
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto1.Marshal
|
|
|
|
type LogDelta struct {
|
|
ID uint64 `protobuf:"varint,1,opt,proto3" json:"ID,omitempty"`
|
|
Quad *Quad `protobuf:"bytes,2,opt" json:"Quad,omitempty"`
|
|
Action int32 `protobuf:"varint,3,opt,proto3" json:"Action,omitempty"`
|
|
Timestamp int64 `protobuf:"varint,4,opt,proto3" json:"Timestamp,omitempty"`
|
|
}
|
|
|
|
func (m *LogDelta) Reset() { *m = LogDelta{} }
|
|
func (m *LogDelta) String() string { return proto1.CompactTextString(m) }
|
|
func (*LogDelta) ProtoMessage() {}
|
|
|
|
func (m *LogDelta) GetQuad() *Quad {
|
|
if m != nil {
|
|
return m.Quad
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type HistoryEntry struct {
|
|
History []uint64 `protobuf:"varint,1,rep" json:"History,omitempty"`
|
|
}
|
|
|
|
func (m *HistoryEntry) Reset() { *m = HistoryEntry{} }
|
|
func (m *HistoryEntry) String() string { return proto1.CompactTextString(m) }
|
|
func (*HistoryEntry) ProtoMessage() {}
|
|
|
|
type NodeData struct {
|
|
Name string `protobuf:"bytes,1,opt,proto3" json:"Name,omitempty"`
|
|
Size_ int64 `protobuf:"varint,2,opt,proto3" json:"Size,omitempty"`
|
|
}
|
|
|
|
func (m *NodeData) Reset() { *m = NodeData{} }
|
|
func (m *NodeData) String() string { return proto1.CompactTextString(m) }
|
|
func (*NodeData) ProtoMessage() {}
|
|
|
|
type Quad struct {
|
|
Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"`
|
|
Predicate string `protobuf:"bytes,2,opt,name=predicate,proto3" json:"predicate,omitempty"`
|
|
Object string `protobuf:"bytes,3,opt,name=object,proto3" json:"object,omitempty"`
|
|
Label string `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"`
|
|
}
|
|
|
|
func (m *Quad) Reset() { *m = Quad{} }
|
|
func (m *Quad) String() string { return proto1.CompactTextString(m) }
|
|
func (*Quad) ProtoMessage() {}
|
|
|
|
func init() {
|
|
}
|
|
func (m *LogDelta) Unmarshal(data []byte) error {
|
|
l := len(data)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 0 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
|
|
}
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
m.ID |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Quad", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.Quad == nil {
|
|
m.Quad = &Quad{}
|
|
}
|
|
if err := m.Quad.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
case 3:
|
|
if wireType != 0 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType)
|
|
}
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
m.Action |= (int32(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
case 4:
|
|
if wireType != 0 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
|
|
}
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
m.Timestamp |= (int64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
default:
|
|
var sizeOfWire int
|
|
for {
|
|
sizeOfWire++
|
|
wire >>= 7
|
|
if wire == 0 {
|
|
break
|
|
}
|
|
}
|
|
iNdEx -= sizeOfWire
|
|
skippy, err := skipSerializations(data[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
func (m *HistoryEntry) Unmarshal(data []byte) error {
|
|
l := len(data)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 0 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field History", wireType)
|
|
}
|
|
var v uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
v |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
m.History = append(m.History, v)
|
|
default:
|
|
var sizeOfWire int
|
|
for {
|
|
sizeOfWire++
|
|
wire >>= 7
|
|
if wire == 0 {
|
|
break
|
|
}
|
|
}
|
|
iNdEx -= sizeOfWire
|
|
skippy, err := skipSerializations(data[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
func (m *NodeData) Unmarshal(data []byte) error {
|
|
l := len(data)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
stringLen |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
postIndex := iNdEx + int(stringLen)
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Name = string(data[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
case 2:
|
|
if wireType != 0 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType)
|
|
}
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
m.Size_ |= (int64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
default:
|
|
var sizeOfWire int
|
|
for {
|
|
sizeOfWire++
|
|
wire >>= 7
|
|
if wire == 0 {
|
|
break
|
|
}
|
|
}
|
|
iNdEx -= sizeOfWire
|
|
skippy, err := skipSerializations(data[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
func (m *Quad) Unmarshal(data []byte) error {
|
|
l := len(data)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
stringLen |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
postIndex := iNdEx + int(stringLen)
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Subject = string(data[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Predicate", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
stringLen |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
postIndex := iNdEx + int(stringLen)
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Predicate = string(data[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
case 3:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Object", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
stringLen |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
postIndex := iNdEx + int(stringLen)
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Object = string(data[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
case 4:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
stringLen |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
postIndex := iNdEx + int(stringLen)
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Label = string(data[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
default:
|
|
var sizeOfWire int
|
|
for {
|
|
sizeOfWire++
|
|
wire >>= 7
|
|
if wire == 0 {
|
|
break
|
|
}
|
|
}
|
|
iNdEx -= sizeOfWire
|
|
skippy, err := skipSerializations(data[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
func skipSerializations(data []byte) (n int, err error) {
|
|
l := len(data)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
wireType := int(wire & 0x7)
|
|
switch wireType {
|
|
case 0:
|
|
for {
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx++
|
|
if data[iNdEx-1] < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
return iNdEx, nil
|
|
case 1:
|
|
iNdEx += 8
|
|
return iNdEx, nil
|
|
case 2:
|
|
var length int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
length |= (int(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
iNdEx += length
|
|
return iNdEx, nil
|
|
case 3:
|
|
for {
|
|
var wire uint64
|
|
var start int = iNdEx
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
wireType := int(wire & 0x7)
|
|
if wireType == 4 {
|
|
break
|
|
}
|
|
next, err := skipSerializations(data[start:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
iNdEx = start + next
|
|
}
|
|
return iNdEx, nil
|
|
case 4:
|
|
return iNdEx, nil
|
|
case 5:
|
|
iNdEx += 4
|
|
return iNdEx, nil
|
|
default:
|
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
}
|
|
}
|
|
panic("unreachable")
|
|
}
|
|
func (m *LogDelta) Size() (n int) {
|
|
var l int
|
|
_ = l
|
|
if m.ID != 0 {
|
|
n += 1 + sovSerializations(uint64(m.ID))
|
|
}
|
|
l = m.Quad.Size()
|
|
n += 1 + l + sovSerializations(uint64(l))
|
|
if m.Action != 0 {
|
|
n += 1 + sovSerializations(uint64(m.Action))
|
|
}
|
|
if m.Timestamp != 0 {
|
|
n += 1 + sovSerializations(uint64(m.Timestamp))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *HistoryEntry) Size() (n int) {
|
|
var l int
|
|
_ = l
|
|
if len(m.History) > 0 {
|
|
for _, e := range m.History {
|
|
n += 1 + sovSerializations(uint64(e))
|
|
}
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *NodeData) Size() (n int) {
|
|
var l int
|
|
_ = l
|
|
l = len(m.Name)
|
|
if l > 0 {
|
|
n += 1 + l + sovSerializations(uint64(l))
|
|
}
|
|
if m.Size_ != 0 {
|
|
n += 1 + sovSerializations(uint64(m.Size_))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *Quad) Size() (n int) {
|
|
var l int
|
|
_ = l
|
|
l = len(m.Subject)
|
|
if l > 0 {
|
|
n += 1 + l + sovSerializations(uint64(l))
|
|
}
|
|
l = len(m.Predicate)
|
|
if l > 0 {
|
|
n += 1 + l + sovSerializations(uint64(l))
|
|
}
|
|
l = len(m.Object)
|
|
if l > 0 {
|
|
n += 1 + l + sovSerializations(uint64(l))
|
|
}
|
|
l = len(m.Label)
|
|
if l > 0 {
|
|
n += 1 + l + sovSerializations(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func sovSerializations(x uint64) (n int) {
|
|
for {
|
|
n++
|
|
x >>= 7
|
|
if x == 0 {
|
|
break
|
|
}
|
|
}
|
|
return n
|
|
}
|
|
func sozSerializations(x uint64) (n int) {
|
|
return sovSerializations(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
}
|
|
func (m *LogDelta) Marshal() (data []byte, err error) {
|
|
size := m.Size()
|
|
data = make([]byte, size)
|
|
n, err := m.MarshalTo(data)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return data[:n], nil
|
|
}
|
|
|
|
func (m *LogDelta) MarshalTo(data []byte) (n int, err error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.ID != 0 {
|
|
data[i] = 0x8
|
|
i++
|
|
i = encodeVarintSerializations(data, i, uint64(m.ID))
|
|
}
|
|
data[i] = 0x12
|
|
i++
|
|
i = encodeVarintSerializations(data, i, uint64(m.Quad.Size()))
|
|
n1, err := m.Quad.MarshalTo(data[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n1
|
|
if m.Action != 0 {
|
|
data[i] = 0x18
|
|
i++
|
|
i = encodeVarintSerializations(data, i, uint64(m.Action))
|
|
}
|
|
if m.Timestamp != 0 {
|
|
data[i] = 0x20
|
|
i++
|
|
i = encodeVarintSerializations(data, i, uint64(m.Timestamp))
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func (m *HistoryEntry) Marshal() (data []byte, err error) {
|
|
size := m.Size()
|
|
data = make([]byte, size)
|
|
n, err := m.MarshalTo(data)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return data[:n], nil
|
|
}
|
|
|
|
func (m *HistoryEntry) MarshalTo(data []byte) (n int, err error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.History) > 0 {
|
|
for _, num := range m.History {
|
|
data[i] = 0x8
|
|
i++
|
|
i = encodeVarintSerializations(data, i, uint64(num))
|
|
}
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func (m *NodeData) Marshal() (data []byte, err error) {
|
|
size := m.Size()
|
|
data = make([]byte, size)
|
|
n, err := m.MarshalTo(data)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return data[:n], nil
|
|
}
|
|
|
|
func (m *NodeData) MarshalTo(data []byte) (n int, err error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.Name) > 0 {
|
|
data[i] = 0xa
|
|
i++
|
|
i = encodeVarintSerializations(data, i, uint64(len(m.Name)))
|
|
i += copy(data[i:], m.Name)
|
|
}
|
|
if m.Size_ != 0 {
|
|
data[i] = 0x10
|
|
i++
|
|
i = encodeVarintSerializations(data, i, uint64(m.Size_))
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func (m *Quad) Marshal() (data []byte, err error) {
|
|
size := m.Size()
|
|
data = make([]byte, size)
|
|
n, err := m.MarshalTo(data)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return data[:n], nil
|
|
}
|
|
|
|
func (m *Quad) MarshalTo(data []byte) (n int, err error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.Subject) > 0 {
|
|
data[i] = 0xa
|
|
i++
|
|
i = encodeVarintSerializations(data, i, uint64(len(m.Subject)))
|
|
i += copy(data[i:], m.Subject)
|
|
}
|
|
if len(m.Predicate) > 0 {
|
|
data[i] = 0x12
|
|
i++
|
|
i = encodeVarintSerializations(data, i, uint64(len(m.Predicate)))
|
|
i += copy(data[i:], m.Predicate)
|
|
}
|
|
if len(m.Object) > 0 {
|
|
data[i] = 0x1a
|
|
i++
|
|
i = encodeVarintSerializations(data, i, uint64(len(m.Object)))
|
|
i += copy(data[i:], m.Object)
|
|
}
|
|
if len(m.Label) > 0 {
|
|
data[i] = 0x22
|
|
i++
|
|
i = encodeVarintSerializations(data, i, uint64(len(m.Label)))
|
|
i += copy(data[i:], m.Label)
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func encodeFixed64Serializations(data []byte, offset int, v uint64) int {
|
|
data[offset] = uint8(v)
|
|
data[offset+1] = uint8(v >> 8)
|
|
data[offset+2] = uint8(v >> 16)
|
|
data[offset+3] = uint8(v >> 24)
|
|
data[offset+4] = uint8(v >> 32)
|
|
data[offset+5] = uint8(v >> 40)
|
|
data[offset+6] = uint8(v >> 48)
|
|
data[offset+7] = uint8(v >> 56)
|
|
return offset + 8
|
|
}
|
|
func encodeFixed32Serializations(data []byte, offset int, v uint32) int {
|
|
data[offset] = uint8(v)
|
|
data[offset+1] = uint8(v >> 8)
|
|
data[offset+2] = uint8(v >> 16)
|
|
data[offset+3] = uint8(v >> 24)
|
|
return offset + 4
|
|
}
|
|
func encodeVarintSerializations(data []byte, offset int, v uint64) int {
|
|
for v >= 1<<7 {
|
|
data[offset] = uint8(v&0x7f | 0x80)
|
|
v >>= 7
|
|
offset++
|
|
}
|
|
data[offset] = uint8(v)
|
|
return offset + 1
|
|
}
|