mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-07 21:47:02 +09:00
968 lines
22 KiB
Go
968 lines
22 KiB
Go
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
|
// source: document/textchangeproto/protos/textchange.proto
|
|
|
|
package textchangeproto
|
|
|
|
import (
|
|
fmt "fmt"
|
|
proto "github.com/gogo/protobuf/proto"
|
|
io "io"
|
|
math "math"
|
|
math_bits "math/bits"
|
|
)
|
|
|
|
// 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.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|
|
|
type TextContent struct {
|
|
// Types that are valid to be assigned to Value:
|
|
//
|
|
// *TextContent_TextAppend
|
|
Value isTextContent_Value `protobuf_oneof:"value"`
|
|
}
|
|
|
|
func (m *TextContent) Reset() { *m = TextContent{} }
|
|
func (m *TextContent) String() string { return proto.CompactTextString(m) }
|
|
func (*TextContent) ProtoMessage() {}
|
|
func (*TextContent) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_44a0c2b66e6c4b48, []int{0}
|
|
}
|
|
func (m *TextContent) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *TextContent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_TextContent.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalToSizedBuffer(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *TextContent) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_TextContent.Merge(m, src)
|
|
}
|
|
func (m *TextContent) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *TextContent) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_TextContent.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_TextContent proto.InternalMessageInfo
|
|
|
|
type isTextContent_Value interface {
|
|
isTextContent_Value()
|
|
MarshalTo([]byte) (int, error)
|
|
Size() int
|
|
}
|
|
|
|
type TextContent_TextAppend struct {
|
|
TextAppend *TextAppend `protobuf:"bytes,1,opt,name=textAppend,proto3,oneof" json:"textAppend,omitempty"`
|
|
}
|
|
|
|
func (*TextContent_TextAppend) isTextContent_Value() {}
|
|
|
|
func (m *TextContent) GetValue() isTextContent_Value {
|
|
if m != nil {
|
|
return m.Value
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *TextContent) GetTextAppend() *TextAppend {
|
|
if x, ok := m.GetValue().(*TextContent_TextAppend); ok {
|
|
return x.TextAppend
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// XXX_OneofWrappers is for the internal use of the proto package.
|
|
func (*TextContent) XXX_OneofWrappers() []interface{} {
|
|
return []interface{}{
|
|
(*TextContent_TextAppend)(nil),
|
|
}
|
|
}
|
|
|
|
type TextAppend struct {
|
|
Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
|
|
}
|
|
|
|
func (m *TextAppend) Reset() { *m = TextAppend{} }
|
|
func (m *TextAppend) String() string { return proto.CompactTextString(m) }
|
|
func (*TextAppend) ProtoMessage() {}
|
|
func (*TextAppend) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_44a0c2b66e6c4b48, []int{1}
|
|
}
|
|
func (m *TextAppend) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *TextAppend) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_TextAppend.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalToSizedBuffer(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *TextAppend) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_TextAppend.Merge(m, src)
|
|
}
|
|
func (m *TextAppend) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *TextAppend) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_TextAppend.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_TextAppend proto.InternalMessageInfo
|
|
|
|
func (m *TextAppend) GetText() string {
|
|
if m != nil {
|
|
return m.Text
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type TextSnapshot struct {
|
|
Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
|
|
}
|
|
|
|
func (m *TextSnapshot) Reset() { *m = TextSnapshot{} }
|
|
func (m *TextSnapshot) String() string { return proto.CompactTextString(m) }
|
|
func (*TextSnapshot) ProtoMessage() {}
|
|
func (*TextSnapshot) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_44a0c2b66e6c4b48, []int{2}
|
|
}
|
|
func (m *TextSnapshot) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *TextSnapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_TextSnapshot.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalToSizedBuffer(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *TextSnapshot) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_TextSnapshot.Merge(m, src)
|
|
}
|
|
func (m *TextSnapshot) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *TextSnapshot) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_TextSnapshot.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_TextSnapshot proto.InternalMessageInfo
|
|
|
|
func (m *TextSnapshot) GetText() string {
|
|
if m != nil {
|
|
return m.Text
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type TextData struct {
|
|
Content []*TextContent `protobuf:"bytes,1,rep,name=content,proto3" json:"content,omitempty"`
|
|
Snapshot *TextSnapshot `protobuf:"bytes,2,opt,name=snapshot,proto3" json:"snapshot,omitempty"`
|
|
}
|
|
|
|
func (m *TextData) Reset() { *m = TextData{} }
|
|
func (m *TextData) String() string { return proto.CompactTextString(m) }
|
|
func (*TextData) ProtoMessage() {}
|
|
func (*TextData) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_44a0c2b66e6c4b48, []int{3}
|
|
}
|
|
func (m *TextData) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *TextData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_TextData.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalToSizedBuffer(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *TextData) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_TextData.Merge(m, src)
|
|
}
|
|
func (m *TextData) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *TextData) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_TextData.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_TextData proto.InternalMessageInfo
|
|
|
|
func (m *TextData) GetContent() []*TextContent {
|
|
if m != nil {
|
|
return m.Content
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *TextData) GetSnapshot() *TextSnapshot {
|
|
if m != nil {
|
|
return m.Snapshot
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*TextContent)(nil), "textchange.TextContent")
|
|
proto.RegisterType((*TextAppend)(nil), "textchange.TextAppend")
|
|
proto.RegisterType((*TextSnapshot)(nil), "textchange.TextSnapshot")
|
|
proto.RegisterType((*TextData)(nil), "textchange.TextData")
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterFile("document/textchangeproto/protos/textchange.proto", fileDescriptor_44a0c2b66e6c4b48)
|
|
}
|
|
|
|
var fileDescriptor_44a0c2b66e6c4b48 = []byte{
|
|
// 239 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x48, 0xc9, 0x4f, 0x2e,
|
|
0xcd, 0x4d, 0xcd, 0x2b, 0xd1, 0x2f, 0x49, 0xad, 0x28, 0x49, 0xce, 0x48, 0xcc, 0x4b, 0x4f, 0x2d,
|
|
0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x07, 0x93, 0xc5, 0x48, 0xc2, 0x7a, 0x60, 0x11, 0x21, 0x2e, 0x84,
|
|
0x88, 0x52, 0x00, 0x17, 0x77, 0x48, 0x6a, 0x45, 0x89, 0x73, 0x7e, 0x5e, 0x49, 0x6a, 0x5e, 0x89,
|
|
0x90, 0x05, 0x17, 0x58, 0xd2, 0xb1, 0xa0, 0x20, 0x35, 0x2f, 0x45, 0x82, 0x51, 0x81, 0x51, 0x83,
|
|
0xdb, 0x48, 0x4c, 0x0f, 0xc9, 0x84, 0x10, 0xb8, 0xac, 0x07, 0x43, 0x10, 0x92, 0x5a, 0x27, 0x76,
|
|
0x2e, 0xd6, 0xb2, 0xc4, 0x9c, 0xd2, 0x54, 0x25, 0x05, 0x2e, 0x2e, 0x84, 0x22, 0x21, 0x21, 0x2e,
|
|
0x16, 0x90, 0x22, 0xb0, 0x51, 0x9c, 0x41, 0x60, 0xb6, 0x92, 0x12, 0x17, 0x0f, 0x48, 0x45, 0x70,
|
|
0x5e, 0x62, 0x41, 0x71, 0x46, 0x7e, 0x09, 0x56, 0x35, 0xc5, 0x5c, 0x1c, 0x20, 0x35, 0x2e, 0x89,
|
|
0x25, 0x89, 0x42, 0x86, 0x5c, 0xec, 0xc9, 0x10, 0xf7, 0x49, 0x30, 0x2a, 0x30, 0x6b, 0x70, 0x1b,
|
|
0x89, 0xa3, 0xbb, 0x08, 0xea, 0xfc, 0x20, 0x98, 0x3a, 0x21, 0x13, 0x2e, 0x8e, 0x62, 0xa8, 0xf1,
|
|
0x12, 0x4c, 0x60, 0x5f, 0x48, 0xa0, 0xeb, 0x81, 0x59, 0x1f, 0x04, 0x57, 0xe9, 0x64, 0x74, 0xe2,
|
|
0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70,
|
|
0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x12, 0xb8, 0x02, 0x39, 0x89, 0x0d, 0x4c,
|
|
0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x87, 0x3d, 0x8c, 0x61, 0x87, 0x01, 0x00, 0x00,
|
|
}
|
|
|
|
func (m *TextContent) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *TextContent) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *TextContent) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.Value != nil {
|
|
{
|
|
size := m.Value.Size()
|
|
i -= size
|
|
if _, err := m.Value.MarshalTo(dAtA[i:]); err != nil {
|
|
return 0, err
|
|
}
|
|
}
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *TextContent_TextAppend) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *TextContent_TextAppend) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
if m.TextAppend != nil {
|
|
{
|
|
size, err := m.TextAppend.MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintTextchange(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
func (m *TextAppend) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *TextAppend) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *TextAppend) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.Text) > 0 {
|
|
i -= len(m.Text)
|
|
copy(dAtA[i:], m.Text)
|
|
i = encodeVarintTextchange(dAtA, i, uint64(len(m.Text)))
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *TextSnapshot) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *TextSnapshot) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *TextSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.Text) > 0 {
|
|
i -= len(m.Text)
|
|
copy(dAtA[i:], m.Text)
|
|
i = encodeVarintTextchange(dAtA, i, uint64(len(m.Text)))
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *TextData) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *TextData) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *TextData) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.Snapshot != nil {
|
|
{
|
|
size, err := m.Snapshot.MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintTextchange(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0x12
|
|
}
|
|
if len(m.Content) > 0 {
|
|
for iNdEx := len(m.Content) - 1; iNdEx >= 0; iNdEx-- {
|
|
{
|
|
size, err := m.Content[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintTextchange(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func encodeVarintTextchange(dAtA []byte, offset int, v uint64) int {
|
|
offset -= sovTextchange(v)
|
|
base := offset
|
|
for v >= 1<<7 {
|
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
|
v >>= 7
|
|
offset++
|
|
}
|
|
dAtA[offset] = uint8(v)
|
|
return base
|
|
}
|
|
func (m *TextContent) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.Value != nil {
|
|
n += m.Value.Size()
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *TextContent_TextAppend) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.TextAppend != nil {
|
|
l = m.TextAppend.Size()
|
|
n += 1 + l + sovTextchange(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
func (m *TextAppend) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = len(m.Text)
|
|
if l > 0 {
|
|
n += 1 + l + sovTextchange(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *TextSnapshot) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = len(m.Text)
|
|
if l > 0 {
|
|
n += 1 + l + sovTextchange(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *TextData) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if len(m.Content) > 0 {
|
|
for _, e := range m.Content {
|
|
l = e.Size()
|
|
n += 1 + l + sovTextchange(uint64(l))
|
|
}
|
|
}
|
|
if m.Snapshot != nil {
|
|
l = m.Snapshot.Size()
|
|
n += 1 + l + sovTextchange(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func sovTextchange(x uint64) (n int) {
|
|
return (math_bits.Len64(x|1) + 6) / 7
|
|
}
|
|
func sozTextchange(x uint64) (n int) {
|
|
return sovTextchange(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
}
|
|
func (m *TextContent) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowTextchange
|
|
}
|
|
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)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: TextContent: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: TextContent: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field TextAppend", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowTextchange
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthTextchange
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthTextchange
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
v := &TextAppend{}
|
|
if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
m.Value = &TextContent_TextAppend{v}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipTextchange(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
return ErrInvalidLengthTextchange
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *TextAppend) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowTextchange
|
|
}
|
|
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)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: TextAppend: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: TextAppend: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowTextchange
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthTextchange
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthTextchange
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Text = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipTextchange(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
return ErrInvalidLengthTextchange
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *TextSnapshot) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowTextchange
|
|
}
|
|
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)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: TextSnapshot: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: TextSnapshot: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowTextchange
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthTextchange
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthTextchange
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Text = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipTextchange(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
return ErrInvalidLengthTextchange
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *TextData) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowTextchange
|
|
}
|
|
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)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: TextData: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: TextData: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowTextchange
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthTextchange
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthTextchange
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Content = append(m.Content, &TextContent{})
|
|
if err := m.Content[len(m.Content)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Snapshot", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowTextchange
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthTextchange
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthTextchange
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.Snapshot == nil {
|
|
m.Snapshot = &TextSnapshot{}
|
|
}
|
|
if err := m.Snapshot.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipTextchange(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
return ErrInvalidLengthTextchange
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func skipTextchange(dAtA []byte) (n int, err error) {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
depth := 0
|
|
for iNdEx < l {
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowTextchange
|
|
}
|
|
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 shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowTextchange
|
|
}
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx++
|
|
if dAtA[iNdEx-1] < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
case 1:
|
|
iNdEx += 8
|
|
case 2:
|
|
var length int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowTextchange
|
|
}
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
length |= (int(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if length < 0 {
|
|
return 0, ErrInvalidLengthTextchange
|
|
}
|
|
iNdEx += length
|
|
case 3:
|
|
depth++
|
|
case 4:
|
|
if depth == 0 {
|
|
return 0, ErrUnexpectedEndOfGroupTextchange
|
|
}
|
|
depth--
|
|
case 5:
|
|
iNdEx += 4
|
|
default:
|
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
}
|
|
if iNdEx < 0 {
|
|
return 0, ErrInvalidLengthTextchange
|
|
}
|
|
if depth == 0 {
|
|
return iNdEx, nil
|
|
}
|
|
}
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
|
|
var (
|
|
ErrInvalidLengthTextchange = fmt.Errorf("proto: negative length found during unmarshaling")
|
|
ErrIntOverflowTextchange = fmt.Errorf("proto: integer overflow")
|
|
ErrUnexpectedEndOfGroupTextchange = fmt.Errorf("proto: unexpected end of group")
|
|
)
|