// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: doc.proto

/*
	Package doc is a generated protocol buffer package.

	It is generated from these files:
		doc.proto

	It has these top-level messages:
		HeartReq
		DocReq
		TokenData
		DeleteReq
		Reply
		SearchReq
		SearchReply
		Text
		Attri
		Logic
		LogicExpression
*/
package doc

import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"

import (
	context "golang.org/x/net/context"
	grpc "google.golang.org/grpc"
)

import io "io"

// 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.GoGoProtoPackageIsVersion2 // please upgrade the proto package

type HeartReq struct {
	Msg int32 `protobuf:"varint,1,opt,name=msg,proto3" json:"msg,omitempty"`
}

func (m *HeartReq) Reset()                    { *m = HeartReq{} }
func (m *HeartReq) String() string            { return proto.CompactTextString(m) }
func (*HeartReq) ProtoMessage()               {}
func (*HeartReq) Descriptor() ([]byte, []int) { return fileDescriptorDoc, []int{0} }

func (m *HeartReq) GetMsg() int32 {
	if m != nil {
		return m.Msg
	}
	return 0
}

// The request message containing the user's name.
type DocReq struct {
	DocId       uint64       `protobuf:"varint,1,opt,name=doc_id,json=docId,proto3" json:"doc_id,omitempty"`
	Content     string       `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
	Attri       []byte       `protobuf:"bytes,3,opt,name=attri,proto3" json:"attri,omitempty"`
	Tokens      []*TokenData `protobuf:"bytes,4,rep,name=tokens" json:"tokens,omitempty"`
	Labels      []string     `protobuf:"bytes,5,rep,name=labels" json:"labels,omitempty"`
	Fields      []byte       `protobuf:"bytes,6,opt,name=fields,proto3" json:"fields,omitempty"`
	ForceUpdate bool         `protobuf:"varint,7,opt,name=forceUpdate,proto3" json:"forceUpdate,omitempty"`
}

func (m *DocReq) Reset()                    { *m = DocReq{} }
func (m *DocReq) String() string            { return proto.CompactTextString(m) }
func (*DocReq) ProtoMessage()               {}
func (*DocReq) Descriptor() ([]byte, []int) { return fileDescriptorDoc, []int{1} }

func (m *DocReq) GetDocId() uint64 {
	if m != nil {
		return m.DocId
	}
	return 0
}

func (m *DocReq) GetContent() string {
	if m != nil {
		return m.Content
	}
	return ""
}

func (m *DocReq) GetAttri() []byte {
	if m != nil {
		return m.Attri
	}
	return nil
}

func (m *DocReq) GetTokens() []*TokenData {
	if m != nil {
		return m.Tokens
	}
	return nil
}

func (m *DocReq) GetLabels() []string {
	if m != nil {
		return m.Labels
	}
	return nil
}

func (m *DocReq) GetFields() []byte {
	if m != nil {
		return m.Fields
	}
	return nil
}

func (m *DocReq) GetForceUpdate() bool {
	if m != nil {
		return m.ForceUpdate
	}
	return false
}

type TokenData struct {
	Text      string  `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
	Locations []int32 `protobuf:"varint,2,rep,packed,name=locations" json:"locations,omitempty"`
}

func (m *TokenData) Reset()                    { *m = TokenData{} }
func (m *TokenData) String() string            { return proto.CompactTextString(m) }
func (*TokenData) ProtoMessage()               {}
func (*TokenData) Descriptor() ([]byte, []int) { return fileDescriptorDoc, []int{2} }

func (m *TokenData) GetText() string {
	if m != nil {
		return m.Text
	}
	return ""
}

func (m *TokenData) GetLocations() []int32 {
	if m != nil {
		return m.Locations
	}
	return nil
}

type DeleteReq struct {
	DocId uint64 `protobuf:"varint,1,opt,name=doc_id,json=docId,proto3" json:"doc_id,omitempty"`
}

func (m *DeleteReq) Reset()                    { *m = DeleteReq{} }
func (m *DeleteReq) String() string            { return proto.CompactTextString(m) }
func (*DeleteReq) ProtoMessage()               {}
func (*DeleteReq) Descriptor() ([]byte, []int) { return fileDescriptorDoc, []int{3} }

func (m *DeleteReq) GetDocId() uint64 {
	if m != nil {
		return m.DocId
	}
	return 0
}

// 0 succeed, 1 fail
type Reply struct {
	Result int32 `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"`
}

func (m *Reply) Reset()                    { *m = Reply{} }
func (m *Reply) String() string            { return proto.CompactTextString(m) }
func (*Reply) ProtoMessage()               {}
func (*Reply) Descriptor() ([]byte, []int) { return fileDescriptorDoc, []int{4} }

func (m *Reply) GetResult() int32 {
	if m != nil {
		return m.Result
	}
	return 0
}

type SearchReq struct {
	Id           string          `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Query        string          `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"`
	OutputOffset int32           `protobuf:"varint,3,opt,name=outputOffset,proto3" json:"outputOffset,omitempty"`
	MaxOutputs   int32           `protobuf:"varint,4,opt,name=maxOutputs,proto3" json:"maxOutputs,omitempty"`
	Time         string          `protobuf:"bytes,5,opt,name=time,proto3" json:"time,omitempty"`
	DocIds       map[uint64]bool `protobuf:"bytes,6,rep,name=docIds" json:"docIds,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
	Logic        *Logic          `protobuf:"bytes,7,opt,name=logic" json:"logic,omitempty"`
}

func (m *SearchReq) Reset()                    { *m = SearchReq{} }
func (m *SearchReq) String() string            { return proto.CompactTextString(m) }
func (*SearchReq) ProtoMessage()               {}
func (*SearchReq) Descriptor() ([]byte, []int) { return fileDescriptorDoc, []int{5} }

func (m *SearchReq) GetId() string {
	if m != nil {
		return m.Id
	}
	return ""
}

func (m *SearchReq) GetQuery() string {
	if m != nil {
		return m.Query
	}
	return ""
}

func (m *SearchReq) GetOutputOffset() int32 {
	if m != nil {
		return m.OutputOffset
	}
	return 0
}

func (m *SearchReq) GetMaxOutputs() int32 {
	if m != nil {
		return m.MaxOutputs
	}
	return 0
}

func (m *SearchReq) GetTime() string {
	if m != nil {
		return m.Time
	}
	return ""
}

func (m *SearchReq) GetDocIds() map[uint64]bool {
	if m != nil {
		return m.DocIds
	}
	return nil
}

func (m *SearchReq) GetLogic() *Logic {
	if m != nil {
		return m.Logic
	}
	return nil
}

type SearchReply struct {
	Code      int32   `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Len       int32   `protobuf:"varint,2,opt,name=len,proto3" json:"len,omitempty"`
	Timestamp int64   `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Docs      []*Text `protobuf:"bytes,4,rep,name=docs" json:"docs,omitempty"`
}

func (m *SearchReply) Reset()                    { *m = SearchReply{} }
func (m *SearchReply) String() string            { return proto.CompactTextString(m) }
func (*SearchReply) ProtoMessage()               {}
func (*SearchReply) Descriptor() ([]byte, []int) { return fileDescriptorDoc, []int{6} }

func (m *SearchReply) GetCode() int32 {
	if m != nil {
		return m.Code
	}
	return 0
}

func (m *SearchReply) GetLen() int32 {
	if m != nil {
		return m.Len
	}
	return 0
}

func (m *SearchReply) GetTimestamp() int64 {
	if m != nil {
		return m.Timestamp
	}
	return 0
}

func (m *SearchReply) GetDocs() []*Text {
	if m != nil {
		return m.Docs
	}
	return nil
}

type Text struct {
	// string id = 1;
	Id      uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
	Attri   *Attri `protobuf:"bytes,3,opt,name=attri" json:"attri,omitempty"`
}

func (m *Text) Reset()                    { *m = Text{} }
func (m *Text) String() string            { return proto.CompactTextString(m) }
func (*Text) ProtoMessage()               {}
func (*Text) Descriptor() ([]byte, []int) { return fileDescriptorDoc, []int{7} }

func (m *Text) GetId() uint64 {
	if m != nil {
		return m.Id
	}
	return 0
}

func (m *Text) GetContent() string {
	if m != nil {
		return m.Content
	}
	return ""
}

func (m *Text) GetAttri() *Attri {
	if m != nil {
		return m.Attri
	}
	return nil
}

type Attri struct {
	Title  string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	Author string `protobuf:"bytes,2,opt,name=author,proto3" json:"author,omitempty"`
	Time   string `protobuf:"bytes,3,opt,name=time,proto3" json:"time,omitempty"`
	Ts     int64  `protobuf:"varint,4,opt,name=ts,proto3" json:"ts,omitempty"`
}

func (m *Attri) Reset()                    { *m = Attri{} }
func (m *Attri) String() string            { return proto.CompactTextString(m) }
func (*Attri) ProtoMessage()               {}
func (*Attri) Descriptor() ([]byte, []int) { return fileDescriptorDoc, []int{8} }

func (m *Attri) GetTitle() string {
	if m != nil {
		return m.Title
	}
	return ""
}

func (m *Attri) GetAuthor() string {
	if m != nil {
		return m.Author
	}
	return ""
}

func (m *Attri) GetTime() string {
	if m != nil {
		return m.Time
	}
	return ""
}

func (m *Attri) GetTs() int64 {
	if m != nil {
		return m.Ts
	}
	return 0
}

type Logic struct {
	// 与查询, 必须都存在
	MustLabels bool `protobuf:"varint,1,opt,name=mustLabels,proto3" json:"mustLabels,omitempty"`
	// 或查询, 有一个存在即可
	ShouldLabels bool `protobuf:"varint,2,opt,name=shouldLabels,proto3" json:"shouldLabels,omitempty"`
	// 非查询, 不包含
	NotInLabels     bool             `protobuf:"varint,3,opt,name=notInLabels,proto3" json:"notInLabels,omitempty"`
	LogicExpression *LogicExpression `protobuf:"bytes,4,opt,name=logicExpression" json:"logicExpression,omitempty"`
}

func (m *Logic) Reset()                    { *m = Logic{} }
func (m *Logic) String() string            { return proto.CompactTextString(m) }
func (*Logic) ProtoMessage()               {}
func (*Logic) Descriptor() ([]byte, []int) { return fileDescriptorDoc, []int{9} }

func (m *Logic) GetMustLabels() bool {
	if m != nil {
		return m.MustLabels
	}
	return false
}

func (m *Logic) GetShouldLabels() bool {
	if m != nil {
		return m.ShouldLabels
	}
	return false
}

func (m *Logic) GetNotInLabels() bool {
	if m != nil {
		return m.NotInLabels
	}
	return false
}

func (m *Logic) GetLogicExpression() *LogicExpression {
	if m != nil {
		return m.LogicExpression
	}
	return nil
}

// LogicExpression logic expression options
type LogicExpression struct {
	// mustLabels, with the query that must exist
	MustLabels []string `protobuf:"bytes,1,rep,name=mustLabels" json:"mustLabels,omitempty"`
	// shouldLabels, there is one can exist
	ShouldLabels []string `protobuf:"bytes,2,rep,name=shouldLabels" json:"shouldLabels,omitempty"`
	// notInLabels, not included
	NotInLabels []string `protobuf:"bytes,3,rep,name=notInLabels" json:"notInLabels,omitempty"`
}

func (m *LogicExpression) Reset()                    { *m = LogicExpression{} }
func (m *LogicExpression) String() string            { return proto.CompactTextString(m) }
func (*LogicExpression) ProtoMessage()               {}
func (*LogicExpression) Descriptor() ([]byte, []int) { return fileDescriptorDoc, []int{10} }

func (m *LogicExpression) GetMustLabels() []string {
	if m != nil {
		return m.MustLabels
	}
	return nil
}

func (m *LogicExpression) GetShouldLabels() []string {
	if m != nil {
		return m.ShouldLabels
	}
	return nil
}

func (m *LogicExpression) GetNotInLabels() []string {
	if m != nil {
		return m.NotInLabels
	}
	return nil
}

func init() {
	proto.RegisterType((*HeartReq)(nil), "doc.HeartReq")
	proto.RegisterType((*DocReq)(nil), "doc.DocReq")
	proto.RegisterType((*TokenData)(nil), "doc.TokenData")
	proto.RegisterType((*DeleteReq)(nil), "doc.DeleteReq")
	proto.RegisterType((*Reply)(nil), "doc.Reply")
	proto.RegisterType((*SearchReq)(nil), "doc.SearchReq")
	proto.RegisterType((*SearchReply)(nil), "doc.SearchReply")
	proto.RegisterType((*Text)(nil), "doc.Text")
	proto.RegisterType((*Attri)(nil), "doc.Attri")
	proto.RegisterType((*Logic)(nil), "doc.Logic")
	proto.RegisterType((*LogicExpression)(nil), "doc.LogicExpression")
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4

// Client API for Greeter service

type GreeterClient interface {
	// Sends a greeting
	HeartBeat(ctx context.Context, in *HeartReq, opts ...grpc.CallOption) (*Reply, error)
	DocInx(ctx context.Context, in *DocReq, opts ...grpc.CallOption) (*Reply, error)
	Delete(ctx context.Context, in *DeleteReq, opts ...grpc.CallOption) (*Reply, error)
	Search(ctx context.Context, in *SearchReq, opts ...grpc.CallOption) (*SearchReply, error)
}

type greeterClient struct {
	cc *grpc.ClientConn
}

func NewGreeterClient(cc *grpc.ClientConn) GreeterClient {
	return &greeterClient{cc}
}

func (c *greeterClient) HeartBeat(ctx context.Context, in *HeartReq, opts ...grpc.CallOption) (*Reply, error) {
	out := new(Reply)
	err := grpc.Invoke(ctx, "/doc.Greeter/HeartBeat", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *greeterClient) DocInx(ctx context.Context, in *DocReq, opts ...grpc.CallOption) (*Reply, error) {
	out := new(Reply)
	err := grpc.Invoke(ctx, "/doc.Greeter/DocInx", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *greeterClient) Delete(ctx context.Context, in *DeleteReq, opts ...grpc.CallOption) (*Reply, error) {
	out := new(Reply)
	err := grpc.Invoke(ctx, "/doc.Greeter/Delete", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *greeterClient) Search(ctx context.Context, in *SearchReq, opts ...grpc.CallOption) (*SearchReply, error) {
	out := new(SearchReply)
	err := grpc.Invoke(ctx, "/doc.Greeter/Search", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// Server API for Greeter service

type GreeterServer interface {
	// Sends a greeting
	HeartBeat(context.Context, *HeartReq) (*Reply, error)
	DocInx(context.Context, *DocReq) (*Reply, error)
	Delete(context.Context, *DeleteReq) (*Reply, error)
	Search(context.Context, *SearchReq) (*SearchReply, error)
}

func RegisterGreeterServer(s *grpc.Server, srv GreeterServer) {
	s.RegisterService(&_Greeter_serviceDesc, srv)
}

func _Greeter_HeartBeat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(HeartReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GreeterServer).HeartBeat(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/doc.Greeter/HeartBeat",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GreeterServer).HeartBeat(ctx, req.(*HeartReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _Greeter_DocInx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DocReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GreeterServer).DocInx(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/doc.Greeter/DocInx",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GreeterServer).DocInx(ctx, req.(*DocReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _Greeter_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GreeterServer).Delete(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/doc.Greeter/Delete",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GreeterServer).Delete(ctx, req.(*DeleteReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _Greeter_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SearchReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GreeterServer).Search(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/doc.Greeter/Search",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GreeterServer).Search(ctx, req.(*SearchReq))
	}
	return interceptor(ctx, in, info, handler)
}

var _Greeter_serviceDesc = grpc.ServiceDesc{
	ServiceName: "doc.Greeter",
	HandlerType: (*GreeterServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "HeartBeat",
			Handler:    _Greeter_HeartBeat_Handler,
		},
		{
			MethodName: "DocInx",
			Handler:    _Greeter_DocInx_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _Greeter_Delete_Handler,
		},
		{
			MethodName: "Search",
			Handler:    _Greeter_Search_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "doc.proto",
}

func (m *HeartReq) 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 *HeartReq) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Msg != 0 {
		dAtA[i] = 0x8
		i++
		i = encodeVarintDoc(dAtA, i, uint64(m.Msg))
	}
	return i, nil
}

func (m *DocReq) 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 *DocReq) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.DocId != 0 {
		dAtA[i] = 0x8
		i++
		i = encodeVarintDoc(dAtA, i, uint64(m.DocId))
	}
	if len(m.Content) > 0 {
		dAtA[i] = 0x12
		i++
		i = encodeVarintDoc(dAtA, i, uint64(len(m.Content)))
		i += copy(dAtA[i:], m.Content)
	}
	if len(m.Attri) > 0 {
		dAtA[i] = 0x1a
		i++
		i = encodeVarintDoc(dAtA, i, uint64(len(m.Attri)))
		i += copy(dAtA[i:], m.Attri)
	}
	if len(m.Tokens) > 0 {
		for _, msg := range m.Tokens {
			dAtA[i] = 0x22
			i++
			i = encodeVarintDoc(dAtA, i, uint64(msg.Size()))
			n, err := msg.MarshalTo(dAtA[i:])
			if err != nil {
				return 0, err
			}
			i += n
		}
	}
	if len(m.Labels) > 0 {
		for _, s := range m.Labels {
			dAtA[i] = 0x2a
			i++
			l = len(s)
			for l >= 1<<7 {
				dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
				l >>= 7
				i++
			}
			dAtA[i] = uint8(l)
			i++
			i += copy(dAtA[i:], s)
		}
	}
	if len(m.Fields) > 0 {
		dAtA[i] = 0x32
		i++
		i = encodeVarintDoc(dAtA, i, uint64(len(m.Fields)))
		i += copy(dAtA[i:], m.Fields)
	}
	if m.ForceUpdate {
		dAtA[i] = 0x38
		i++
		if m.ForceUpdate {
			dAtA[i] = 1
		} else {
			dAtA[i] = 0
		}
		i++
	}
	return i, nil
}

func (m *TokenData) 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 *TokenData) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if len(m.Text) > 0 {
		dAtA[i] = 0xa
		i++
		i = encodeVarintDoc(dAtA, i, uint64(len(m.Text)))
		i += copy(dAtA[i:], m.Text)
	}
	if len(m.Locations) > 0 {
		dAtA2 := make([]byte, len(m.Locations)*10)
		var j1 int
		for _, num1 := range m.Locations {
			num := uint64(num1)
			for num >= 1<<7 {
				dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80)
				num >>= 7
				j1++
			}
			dAtA2[j1] = uint8(num)
			j1++
		}
		dAtA[i] = 0x12
		i++
		i = encodeVarintDoc(dAtA, i, uint64(j1))
		i += copy(dAtA[i:], dAtA2[:j1])
	}
	return i, nil
}

func (m *DeleteReq) 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 *DeleteReq) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.DocId != 0 {
		dAtA[i] = 0x8
		i++
		i = encodeVarintDoc(dAtA, i, uint64(m.DocId))
	}
	return i, nil
}

func (m *Reply) 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 *Reply) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Result != 0 {
		dAtA[i] = 0x8
		i++
		i = encodeVarintDoc(dAtA, i, uint64(m.Result))
	}
	return i, nil
}

func (m *SearchReq) 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 *SearchReq) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if len(m.Id) > 0 {
		dAtA[i] = 0xa
		i++
		i = encodeVarintDoc(dAtA, i, uint64(len(m.Id)))
		i += copy(dAtA[i:], m.Id)
	}
	if len(m.Query) > 0 {
		dAtA[i] = 0x12
		i++
		i = encodeVarintDoc(dAtA, i, uint64(len(m.Query)))
		i += copy(dAtA[i:], m.Query)
	}
	if m.OutputOffset != 0 {
		dAtA[i] = 0x18
		i++
		i = encodeVarintDoc(dAtA, i, uint64(m.OutputOffset))
	}
	if m.MaxOutputs != 0 {
		dAtA[i] = 0x20
		i++
		i = encodeVarintDoc(dAtA, i, uint64(m.MaxOutputs))
	}
	if len(m.Time) > 0 {
		dAtA[i] = 0x2a
		i++
		i = encodeVarintDoc(dAtA, i, uint64(len(m.Time)))
		i += copy(dAtA[i:], m.Time)
	}
	if len(m.DocIds) > 0 {
		for k, _ := range m.DocIds {
			dAtA[i] = 0x32
			i++
			v := m.DocIds[k]
			mapSize := 1 + sovDoc(uint64(k)) + 1 + 1
			i = encodeVarintDoc(dAtA, i, uint64(mapSize))
			dAtA[i] = 0x8
			i++
			i = encodeVarintDoc(dAtA, i, uint64(k))
			dAtA[i] = 0x10
			i++
			if v {
				dAtA[i] = 1
			} else {
				dAtA[i] = 0
			}
			i++
		}
	}
	if m.Logic != nil {
		dAtA[i] = 0x3a
		i++
		i = encodeVarintDoc(dAtA, i, uint64(m.Logic.Size()))
		n3, err := m.Logic.MarshalTo(dAtA[i:])
		if err != nil {
			return 0, err
		}
		i += n3
	}
	return i, nil
}

func (m *SearchReply) 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 *SearchReply) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Code != 0 {
		dAtA[i] = 0x8
		i++
		i = encodeVarintDoc(dAtA, i, uint64(m.Code))
	}
	if m.Len != 0 {
		dAtA[i] = 0x10
		i++
		i = encodeVarintDoc(dAtA, i, uint64(m.Len))
	}
	if m.Timestamp != 0 {
		dAtA[i] = 0x18
		i++
		i = encodeVarintDoc(dAtA, i, uint64(m.Timestamp))
	}
	if len(m.Docs) > 0 {
		for _, msg := range m.Docs {
			dAtA[i] = 0x22
			i++
			i = encodeVarintDoc(dAtA, i, uint64(msg.Size()))
			n, err := msg.MarshalTo(dAtA[i:])
			if err != nil {
				return 0, err
			}
			i += n
		}
	}
	return i, nil
}

func (m *Text) 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 *Text) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Id != 0 {
		dAtA[i] = 0x8
		i++
		i = encodeVarintDoc(dAtA, i, uint64(m.Id))
	}
	if len(m.Content) > 0 {
		dAtA[i] = 0x12
		i++
		i = encodeVarintDoc(dAtA, i, uint64(len(m.Content)))
		i += copy(dAtA[i:], m.Content)
	}
	if m.Attri != nil {
		dAtA[i] = 0x1a
		i++
		i = encodeVarintDoc(dAtA, i, uint64(m.Attri.Size()))
		n4, err := m.Attri.MarshalTo(dAtA[i:])
		if err != nil {
			return 0, err
		}
		i += n4
	}
	return i, nil
}

func (m *Attri) 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 *Attri) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if len(m.Title) > 0 {
		dAtA[i] = 0xa
		i++
		i = encodeVarintDoc(dAtA, i, uint64(len(m.Title)))
		i += copy(dAtA[i:], m.Title)
	}
	if len(m.Author) > 0 {
		dAtA[i] = 0x12
		i++
		i = encodeVarintDoc(dAtA, i, uint64(len(m.Author)))
		i += copy(dAtA[i:], m.Author)
	}
	if len(m.Time) > 0 {
		dAtA[i] = 0x1a
		i++
		i = encodeVarintDoc(dAtA, i, uint64(len(m.Time)))
		i += copy(dAtA[i:], m.Time)
	}
	if m.Ts != 0 {
		dAtA[i] = 0x20
		i++
		i = encodeVarintDoc(dAtA, i, uint64(m.Ts))
	}
	return i, nil
}

func (m *Logic) 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 *Logic) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.MustLabels {
		dAtA[i] = 0x8
		i++
		if m.MustLabels {
			dAtA[i] = 1
		} else {
			dAtA[i] = 0
		}
		i++
	}
	if m.ShouldLabels {
		dAtA[i] = 0x10
		i++
		if m.ShouldLabels {
			dAtA[i] = 1
		} else {
			dAtA[i] = 0
		}
		i++
	}
	if m.NotInLabels {
		dAtA[i] = 0x18
		i++
		if m.NotInLabels {
			dAtA[i] = 1
		} else {
			dAtA[i] = 0
		}
		i++
	}
	if m.LogicExpression != nil {
		dAtA[i] = 0x22
		i++
		i = encodeVarintDoc(dAtA, i, uint64(m.LogicExpression.Size()))
		n5, err := m.LogicExpression.MarshalTo(dAtA[i:])
		if err != nil {
			return 0, err
		}
		i += n5
	}
	return i, nil
}

func (m *LogicExpression) 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 *LogicExpression) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if len(m.MustLabels) > 0 {
		for _, s := range m.MustLabels {
			dAtA[i] = 0xa
			i++
			l = len(s)
			for l >= 1<<7 {
				dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
				l >>= 7
				i++
			}
			dAtA[i] = uint8(l)
			i++
			i += copy(dAtA[i:], s)
		}
	}
	if len(m.ShouldLabels) > 0 {
		for _, s := range m.ShouldLabels {
			dAtA[i] = 0x12
			i++
			l = len(s)
			for l >= 1<<7 {
				dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
				l >>= 7
				i++
			}
			dAtA[i] = uint8(l)
			i++
			i += copy(dAtA[i:], s)
		}
	}
	if len(m.NotInLabels) > 0 {
		for _, s := range m.NotInLabels {
			dAtA[i] = 0x1a
			i++
			l = len(s)
			for l >= 1<<7 {
				dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
				l >>= 7
				i++
			}
			dAtA[i] = uint8(l)
			i++
			i += copy(dAtA[i:], s)
		}
	}
	return i, nil
}

func encodeFixed64Doc(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 encodeFixed32Doc(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 encodeVarintDoc(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
}
func (m *HeartReq) Size() (n int) {
	var l int
	_ = l
	if m.Msg != 0 {
		n += 1 + sovDoc(uint64(m.Msg))
	}
	return n
}

func (m *DocReq) Size() (n int) {
	var l int
	_ = l
	if m.DocId != 0 {
		n += 1 + sovDoc(uint64(m.DocId))
	}
	l = len(m.Content)
	if l > 0 {
		n += 1 + l + sovDoc(uint64(l))
	}
	l = len(m.Attri)
	if l > 0 {
		n += 1 + l + sovDoc(uint64(l))
	}
	if len(m.Tokens) > 0 {
		for _, e := range m.Tokens {
			l = e.Size()
			n += 1 + l + sovDoc(uint64(l))
		}
	}
	if len(m.Labels) > 0 {
		for _, s := range m.Labels {
			l = len(s)
			n += 1 + l + sovDoc(uint64(l))
		}
	}
	l = len(m.Fields)
	if l > 0 {
		n += 1 + l + sovDoc(uint64(l))
	}
	if m.ForceUpdate {
		n += 2
	}
	return n
}

func (m *TokenData) Size() (n int) {
	var l int
	_ = l
	l = len(m.Text)
	if l > 0 {
		n += 1 + l + sovDoc(uint64(l))
	}
	if len(m.Locations) > 0 {
		l = 0
		for _, e := range m.Locations {
			l += sovDoc(uint64(e))
		}
		n += 1 + sovDoc(uint64(l)) + l
	}
	return n
}

func (m *DeleteReq) Size() (n int) {
	var l int
	_ = l
	if m.DocId != 0 {
		n += 1 + sovDoc(uint64(m.DocId))
	}
	return n
}

func (m *Reply) Size() (n int) {
	var l int
	_ = l
	if m.Result != 0 {
		n += 1 + sovDoc(uint64(m.Result))
	}
	return n
}

func (m *SearchReq) Size() (n int) {
	var l int
	_ = l
	l = len(m.Id)
	if l > 0 {
		n += 1 + l + sovDoc(uint64(l))
	}
	l = len(m.Query)
	if l > 0 {
		n += 1 + l + sovDoc(uint64(l))
	}
	if m.OutputOffset != 0 {
		n += 1 + sovDoc(uint64(m.OutputOffset))
	}
	if m.MaxOutputs != 0 {
		n += 1 + sovDoc(uint64(m.MaxOutputs))
	}
	l = len(m.Time)
	if l > 0 {
		n += 1 + l + sovDoc(uint64(l))
	}
	if len(m.DocIds) > 0 {
		for k, v := range m.DocIds {
			_ = k
			_ = v
			mapEntrySize := 1 + sovDoc(uint64(k)) + 1 + 1
			n += mapEntrySize + 1 + sovDoc(uint64(mapEntrySize))
		}
	}
	if m.Logic != nil {
		l = m.Logic.Size()
		n += 1 + l + sovDoc(uint64(l))
	}
	return n
}

func (m *SearchReply) Size() (n int) {
	var l int
	_ = l
	if m.Code != 0 {
		n += 1 + sovDoc(uint64(m.Code))
	}
	if m.Len != 0 {
		n += 1 + sovDoc(uint64(m.Len))
	}
	if m.Timestamp != 0 {
		n += 1 + sovDoc(uint64(m.Timestamp))
	}
	if len(m.Docs) > 0 {
		for _, e := range m.Docs {
			l = e.Size()
			n += 1 + l + sovDoc(uint64(l))
		}
	}
	return n
}

func (m *Text) Size() (n int) {
	var l int
	_ = l
	if m.Id != 0 {
		n += 1 + sovDoc(uint64(m.Id))
	}
	l = len(m.Content)
	if l > 0 {
		n += 1 + l + sovDoc(uint64(l))
	}
	if m.Attri != nil {
		l = m.Attri.Size()
		n += 1 + l + sovDoc(uint64(l))
	}
	return n
}

func (m *Attri) Size() (n int) {
	var l int
	_ = l
	l = len(m.Title)
	if l > 0 {
		n += 1 + l + sovDoc(uint64(l))
	}
	l = len(m.Author)
	if l > 0 {
		n += 1 + l + sovDoc(uint64(l))
	}
	l = len(m.Time)
	if l > 0 {
		n += 1 + l + sovDoc(uint64(l))
	}
	if m.Ts != 0 {
		n += 1 + sovDoc(uint64(m.Ts))
	}
	return n
}

func (m *Logic) Size() (n int) {
	var l int
	_ = l
	if m.MustLabels {
		n += 2
	}
	if m.ShouldLabels {
		n += 2
	}
	if m.NotInLabels {
		n += 2
	}
	if m.LogicExpression != nil {
		l = m.LogicExpression.Size()
		n += 1 + l + sovDoc(uint64(l))
	}
	return n
}

func (m *LogicExpression) Size() (n int) {
	var l int
	_ = l
	if len(m.MustLabels) > 0 {
		for _, s := range m.MustLabels {
			l = len(s)
			n += 1 + l + sovDoc(uint64(l))
		}
	}
	if len(m.ShouldLabels) > 0 {
		for _, s := range m.ShouldLabels {
			l = len(s)
			n += 1 + l + sovDoc(uint64(l))
		}
	}
	if len(m.NotInLabels) > 0 {
		for _, s := range m.NotInLabels {
			l = len(s)
			n += 1 + l + sovDoc(uint64(l))
		}
	}
	return n
}

func sovDoc(x uint64) (n int) {
	for {
		n++
		x >>= 7
		if x == 0 {
			break
		}
	}
	return n
}
func sozDoc(x uint64) (n int) {
	return sovDoc(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *HeartReq) 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 ErrIntOverflowDoc
			}
			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: HeartReq: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: HeartReq: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType)
			}
			m.Msg = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Msg |= (int32(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		default:
			iNdEx = preIndex
			skippy, err := skipDoc(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthDoc
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *DocReq) 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 ErrIntOverflowDoc
			}
			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: DocReq: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: DocReq: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field DocId", wireType)
			}
			m.DocId = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.DocId |= (uint64(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				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 ErrInvalidLengthDoc
			}
			postIndex := iNdEx + intStringLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Content = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Attri", wireType)
			}
			var byteLen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				byteLen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if byteLen < 0 {
				return ErrInvalidLengthDoc
			}
			postIndex := iNdEx + byteLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Attri = append(m.Attri[:0], dAtA[iNdEx:postIndex]...)
			if m.Attri == nil {
				m.Attri = []byte{}
			}
			iNdEx = postIndex
		case 4:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Tokens", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthDoc
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Tokens = append(m.Tokens, &TokenData{})
			if err := m.Tokens[len(m.Tokens)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 5:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				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 ErrInvalidLengthDoc
			}
			postIndex := iNdEx + intStringLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Labels = append(m.Labels, string(dAtA[iNdEx:postIndex]))
			iNdEx = postIndex
		case 6:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Fields", wireType)
			}
			var byteLen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				byteLen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if byteLen < 0 {
				return ErrInvalidLengthDoc
			}
			postIndex := iNdEx + byteLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Fields = append(m.Fields[:0], dAtA[iNdEx:postIndex]...)
			if m.Fields == nil {
				m.Fields = []byte{}
			}
			iNdEx = postIndex
		case 7:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field ForceUpdate", wireType)
			}
			var v int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				v |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			m.ForceUpdate = bool(v != 0)
		default:
			iNdEx = preIndex
			skippy, err := skipDoc(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthDoc
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *TokenData) 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 ErrIntOverflowDoc
			}
			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: TokenData: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: TokenData: 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 ErrIntOverflowDoc
				}
				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 ErrInvalidLengthDoc
			}
			postIndex := iNdEx + intStringLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Text = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 2:
			if wireType == 0 {
				var v int32
				for shift := uint(0); ; shift += 7 {
					if shift >= 64 {
						return ErrIntOverflowDoc
					}
					if iNdEx >= l {
						return io.ErrUnexpectedEOF
					}
					b := dAtA[iNdEx]
					iNdEx++
					v |= (int32(b) & 0x7F) << shift
					if b < 0x80 {
						break
					}
				}
				m.Locations = append(m.Locations, v)
			} else if wireType == 2 {
				var packedLen int
				for shift := uint(0); ; shift += 7 {
					if shift >= 64 {
						return ErrIntOverflowDoc
					}
					if iNdEx >= l {
						return io.ErrUnexpectedEOF
					}
					b := dAtA[iNdEx]
					iNdEx++
					packedLen |= (int(b) & 0x7F) << shift
					if b < 0x80 {
						break
					}
				}
				if packedLen < 0 {
					return ErrInvalidLengthDoc
				}
				postIndex := iNdEx + packedLen
				if postIndex > l {
					return io.ErrUnexpectedEOF
				}
				for iNdEx < postIndex {
					var v int32
					for shift := uint(0); ; shift += 7 {
						if shift >= 64 {
							return ErrIntOverflowDoc
						}
						if iNdEx >= l {
							return io.ErrUnexpectedEOF
						}
						b := dAtA[iNdEx]
						iNdEx++
						v |= (int32(b) & 0x7F) << shift
						if b < 0x80 {
							break
						}
					}
					m.Locations = append(m.Locations, v)
				}
			} else {
				return fmt.Errorf("proto: wrong wireType = %d for field Locations", wireType)
			}
		default:
			iNdEx = preIndex
			skippy, err := skipDoc(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthDoc
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *DeleteReq) 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 ErrIntOverflowDoc
			}
			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: DeleteReq: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: DeleteReq: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field DocId", wireType)
			}
			m.DocId = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.DocId |= (uint64(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		default:
			iNdEx = preIndex
			skippy, err := skipDoc(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthDoc
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *Reply) 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 ErrIntOverflowDoc
			}
			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: Reply: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: Reply: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType)
			}
			m.Result = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Result |= (int32(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		default:
			iNdEx = preIndex
			skippy, err := skipDoc(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthDoc
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *SearchReq) 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 ErrIntOverflowDoc
			}
			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: SearchReq: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: SearchReq: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				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 ErrInvalidLengthDoc
			}
			postIndex := iNdEx + intStringLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Id = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				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 ErrInvalidLengthDoc
			}
			postIndex := iNdEx + intStringLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Query = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 3:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field OutputOffset", wireType)
			}
			m.OutputOffset = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.OutputOffset |= (int32(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 4:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field MaxOutputs", wireType)
			}
			m.MaxOutputs = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.MaxOutputs |= (int32(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 5:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				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 ErrInvalidLengthDoc
			}
			postIndex := iNdEx + intStringLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Time = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 6:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field DocIds", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthDoc
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.DocIds == nil {
				m.DocIds = make(map[uint64]bool)
			}
			var mapkey uint64
			var mapvalue bool
			for iNdEx < postIndex {
				entryPreIndex := iNdEx
				var wire uint64
				for shift := uint(0); ; shift += 7 {
					if shift >= 64 {
						return ErrIntOverflowDoc
					}
					if iNdEx >= l {
						return io.ErrUnexpectedEOF
					}
					b := dAtA[iNdEx]
					iNdEx++
					wire |= (uint64(b) & 0x7F) << shift
					if b < 0x80 {
						break
					}
				}
				fieldNum := int32(wire >> 3)
				if fieldNum == 1 {
					for shift := uint(0); ; shift += 7 {
						if shift >= 64 {
							return ErrIntOverflowDoc
						}
						if iNdEx >= l {
							return io.ErrUnexpectedEOF
						}
						b := dAtA[iNdEx]
						iNdEx++
						mapkey |= (uint64(b) & 0x7F) << shift
						if b < 0x80 {
							break
						}
					}
				} else if fieldNum == 2 {
					var mapvaluetemp int
					for shift := uint(0); ; shift += 7 {
						if shift >= 64 {
							return ErrIntOverflowDoc
						}
						if iNdEx >= l {
							return io.ErrUnexpectedEOF
						}
						b := dAtA[iNdEx]
						iNdEx++
						mapvaluetemp |= (int(b) & 0x7F) << shift
						if b < 0x80 {
							break
						}
					}
					mapvalue = bool(mapvaluetemp != 0)
				} else {
					iNdEx = entryPreIndex
					skippy, err := skipDoc(dAtA[iNdEx:])
					if err != nil {
						return err
					}
					if skippy < 0 {
						return ErrInvalidLengthDoc
					}
					if (iNdEx + skippy) > postIndex {
						return io.ErrUnexpectedEOF
					}
					iNdEx += skippy
				}
			}
			m.DocIds[mapkey] = mapvalue
			iNdEx = postIndex
		case 7:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Logic", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthDoc
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Logic == nil {
				m.Logic = &Logic{}
			}
			if err := m.Logic.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipDoc(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthDoc
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *SearchReply) 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 ErrIntOverflowDoc
			}
			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: SearchReply: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: SearchReply: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType)
			}
			m.Code = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Code |= (int32(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Len", wireType)
			}
			m.Len = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Len |= (int32(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 3:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
			}
			m.Timestamp = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Timestamp |= (int64(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 4:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Docs", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthDoc
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Docs = append(m.Docs, &Text{})
			if err := m.Docs[len(m.Docs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipDoc(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthDoc
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *Text) 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 ErrIntOverflowDoc
			}
			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: Text: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: Text: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
			}
			m.Id = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				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 Content", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				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 ErrInvalidLengthDoc
			}
			postIndex := iNdEx + intStringLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Content = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Attri", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthDoc
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Attri == nil {
				m.Attri = &Attri{}
			}
			if err := m.Attri.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipDoc(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthDoc
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *Attri) 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 ErrIntOverflowDoc
			}
			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: Attri: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: Attri: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				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 ErrInvalidLengthDoc
			}
			postIndex := iNdEx + intStringLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Title = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Author", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				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 ErrInvalidLengthDoc
			}
			postIndex := iNdEx + intStringLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Author = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				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 ErrInvalidLengthDoc
			}
			postIndex := iNdEx + intStringLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Time = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 4:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Ts", wireType)
			}
			m.Ts = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Ts |= (int64(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		default:
			iNdEx = preIndex
			skippy, err := skipDoc(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthDoc
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *Logic) 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 ErrIntOverflowDoc
			}
			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: Logic: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: Logic: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field MustLabels", wireType)
			}
			var v int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				v |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			m.MustLabels = bool(v != 0)
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field ShouldLabels", wireType)
			}
			var v int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				v |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			m.ShouldLabels = bool(v != 0)
		case 3:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field NotInLabels", wireType)
			}
			var v int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				v |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			m.NotInLabels = bool(v != 0)
		case 4:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field LogicExpression", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthDoc
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.LogicExpression == nil {
				m.LogicExpression = &LogicExpression{}
			}
			if err := m.LogicExpression.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipDoc(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthDoc
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *LogicExpression) 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 ErrIntOverflowDoc
			}
			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: LogicExpression: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: LogicExpression: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field MustLabels", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				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 ErrInvalidLengthDoc
			}
			postIndex := iNdEx + intStringLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.MustLabels = append(m.MustLabels, string(dAtA[iNdEx:postIndex]))
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ShouldLabels", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				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 ErrInvalidLengthDoc
			}
			postIndex := iNdEx + intStringLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.ShouldLabels = append(m.ShouldLabels, string(dAtA[iNdEx:postIndex]))
			iNdEx = postIndex
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field NotInLabels", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowDoc
				}
				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 ErrInvalidLengthDoc
			}
			postIndex := iNdEx + intStringLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.NotInLabels = append(m.NotInLabels, string(dAtA[iNdEx:postIndex]))
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipDoc(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthDoc
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func skipDoc(dAtA []byte) (n int, err error) {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return 0, ErrIntOverflowDoc
			}
			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, ErrIntOverflowDoc
				}
				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 shift >= 64 {
					return 0, ErrIntOverflowDoc
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				length |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			iNdEx += length
			if length < 0 {
				return 0, ErrInvalidLengthDoc
			}
			return iNdEx, nil
		case 3:
			for {
				var innerWire uint64
				var start int = iNdEx
				for shift := uint(0); ; shift += 7 {
					if shift >= 64 {
						return 0, ErrIntOverflowDoc
					}
					if iNdEx >= l {
						return 0, io.ErrUnexpectedEOF
					}
					b := dAtA[iNdEx]
					iNdEx++
					innerWire |= (uint64(b) & 0x7F) << shift
					if b < 0x80 {
						break
					}
				}
				innerWireType := int(innerWire & 0x7)
				if innerWireType == 4 {
					break
				}
				next, err := skipDoc(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")
}

var (
	ErrInvalidLengthDoc = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowDoc   = fmt.Errorf("proto: integer overflow")
)

func init() { proto.RegisterFile("doc.proto", fileDescriptorDoc) }

var fileDescriptorDoc = []byte{
	// 722 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0xc1, 0x6e, 0xd3, 0x4c,
	0x10, 0xfe, 0x6d, 0xc7, 0x6e, 0x3d, 0xe9, 0xdf, 0x56, 0xab, 0xfe, 0xbf, 0xac, 0xa8, 0x04, 0xcb,
	0x48, 0x95, 0x0f, 0xa8, 0x87, 0x70, 0x01, 0x24, 0x90, 0xa8, 0x52, 0xd1, 0x48, 0x95, 0x2a, 0x2d,
	0x20, 0xc4, 0x09, 0xb9, 0xf6, 0xa4, 0xb5, 0xea, 0x78, 0x53, 0x7b, 0x0d, 0xc9, 0xab, 0x70, 0xe4,
	0x0e, 0xcf, 0x01, 0x37, 0x1e, 0x01, 0xf5, 0x49, 0xd0, 0xce, 0x6e, 0x12, 0x37, 0xa8, 0x70, 0xdb,
	0xf9, 0xe6, 0xf3, 0x7a, 0xe6, 0xfb, 0x66, 0x07, 0xfc, 0x4c, 0xa4, 0x87, 0xd3, 0x4a, 0x48, 0xc1,
	0x9c, 0x4c, 0xa4, 0xd1, 0x3e, 0x6c, 0x9e, 0x60, 0x52, 0x49, 0x8e, 0xd7, 0x6c, 0x17, 0x9c, 0x49,
	0x7d, 0x11, 0x58, 0xa1, 0x15, 0xbb, 0x5c, 0x1d, 0xa3, 0xef, 0x16, 0x78, 0x43, 0x91, 0xaa, 0xe4,
	0x7f, 0xe0, 0x65, 0x22, 0x7d, 0x9f, 0x67, 0x94, 0xef, 0x70, 0x37, 0x13, 0xe9, 0x28, 0x63, 0x01,
	0x6c, 0xa4, 0xa2, 0x94, 0x58, 0xca, 0xc0, 0x0e, 0xad, 0xd8, 0xe7, 0x8b, 0x90, 0xed, 0x81, 0x9b,
	0x48, 0x59, 0xe5, 0x81, 0x13, 0x5a, 0xf1, 0x16, 0xd7, 0x01, 0x3b, 0x00, 0x4f, 0x8a, 0x2b, 0x2c,
	0xeb, 0xa0, 0x13, 0x3a, 0x71, 0x77, 0xb0, 0x7d, 0xa8, 0x0a, 0x7a, 0xad, 0xa0, 0x61, 0x22, 0x13,
	0x6e, 0xb2, 0xec, 0x7f, 0xf0, 0x8a, 0xe4, 0x1c, 0x8b, 0x3a, 0x70, 0x43, 0x27, 0xf6, 0xb9, 0x89,
	0x14, 0x3e, 0xce, 0xb1, 0xc8, 0xea, 0xc0, 0xa3, 0x6b, 0x4d, 0xc4, 0x42, 0xe8, 0x8e, 0x45, 0x95,
	0xe2, 0x9b, 0x69, 0x96, 0x48, 0x0c, 0x36, 0x42, 0x2b, 0xde, 0xe4, 0x6d, 0x28, 0x7a, 0x06, 0xfe,
	0xf2, 0x37, 0x8c, 0x41, 0x47, 0xe2, 0x4c, 0x52, 0x2f, 0x3e, 0xa7, 0x33, 0xdb, 0x07, 0xbf, 0x10,
	0x69, 0x22, 0x73, 0x51, 0xd6, 0x81, 0x1d, 0x3a, 0xb1, 0xcb, 0x57, 0x40, 0x14, 0x81, 0x3f, 0xc4,
	0x02, 0x25, 0xde, 0x2d, 0x46, 0x74, 0x1f, 0x5c, 0x8e, 0xd3, 0x62, 0xae, 0xaa, 0xac, 0xb0, 0x6e,
	0x0a, 0x69, 0xc4, 0x34, 0x51, 0xf4, 0xc9, 0x06, 0xff, 0x15, 0x26, 0x55, 0x7a, 0xa9, 0x6e, 0xd9,
	0x06, 0xdb, 0xdc, 0xe0, 0x73, 0x3b, 0xcf, 0x94, 0x62, 0xd7, 0x0d, 0x56, 0x73, 0xa3, 0xa4, 0x0e,
	0x58, 0x04, 0x5b, 0xa2, 0x91, 0xd3, 0x46, 0x9e, 0x8d, 0xc7, 0x35, 0x4a, 0x92, 0xd3, 0xe5, 0xb7,
	0x30, 0xd6, 0x07, 0x98, 0x24, 0xb3, 0x33, 0x82, 0x94, 0xb2, 0x8a, 0xd1, 0x42, 0xa8, 0xdd, 0x7c,
	0x82, 0x81, 0x6b, 0xda, 0xcd, 0x27, 0xc8, 0x06, 0xd4, 0xc3, 0x88, 0x94, 0x54, 0x4e, 0xf4, 0xc8,
	0x89, 0x65, 0x75, 0x87, 0x43, 0x4a, 0x1e, 0x97, 0xb2, 0x9a, 0x73, 0xc3, 0x64, 0x21, 0xb8, 0x85,
	0xb8, 0xc8, 0x53, 0xd2, 0xb7, 0x3b, 0x00, 0xfa, 0xe4, 0x54, 0x21, 0x5c, 0x27, 0x7a, 0x4f, 0xa0,
	0xdb, 0xfa, 0x50, 0x8d, 0xd4, 0x15, 0xce, 0x8d, 0x4a, 0xea, 0xa8, 0x9a, 0xfc, 0x90, 0x14, 0x0d,
	0x52, 0x93, 0x9b, 0x5c, 0x07, 0x4f, 0xed, 0xc7, 0x56, 0x34, 0x85, 0xee, 0xe2, 0xef, 0x4a, 0x43,
	0x06, 0x9d, 0x54, 0x64, 0x68, 0x14, 0xa4, 0xb3, 0xba, 0xae, 0xc0, 0x92, 0x3e, 0x75, 0xb9, 0x3a,
	0x2a, 0xd3, 0x54, 0x37, 0xb5, 0x4c, 0x26, 0x53, 0x92, 0xc6, 0xe1, 0x2b, 0x80, 0xdd, 0x83, 0x4e,
	0x26, 0xd2, 0xc5, 0xac, 0xf9, 0x7a, 0xd6, 0x70, 0x26, 0x39, 0xc1, 0x11, 0x87, 0x8e, 0x8a, 0x5a,
	0x46, 0x74, 0xc8, 0x88, 0xbb, 0x87, 0x3a, 0x6c, 0x0f, 0xf5, 0x42, 0x80, 0x17, 0x0a, 0x31, 0x03,
	0x1e, 0xbd, 0x03, 0x97, 0x62, 0xd5, 0xa8, 0xcc, 0x65, 0x81, 0xc6, 0x60, 0x1d, 0xa8, 0xc9, 0x48,
	0x1a, 0x79, 0x29, 0x2a, 0x73, 0xb3, 0x89, 0x96, 0x0e, 0x39, 0x2d, 0x87, 0xb6, 0xc1, 0x36, 0x6e,
	0x3a, 0xdc, 0x96, 0x75, 0xf4, 0xc5, 0x02, 0x97, 0xc4, 0x26, 0xbf, 0x9b, 0x5a, 0x9e, 0xea, 0x17,
	0x62, 0x91, 0x92, 0x2d, 0x44, 0xcd, 0x4c, 0x7d, 0x29, 0x9a, 0x22, 0x33, 0x0c, 0xad, 0xf5, 0x2d,
	0x4c, 0xbd, 0x98, 0x52, 0xc8, 0x51, 0x69, 0x28, 0x8e, 0x7e, 0x31, 0x2d, 0x88, 0x3d, 0x87, 0x1d,
	0x32, 0xf5, 0x78, 0x36, 0xad, 0xb0, 0xae, 0x73, 0x51, 0x52, 0x31, 0xdd, 0xc1, 0xde, 0xca, 0xf7,
	0x55, 0x8e, 0xaf, 0x93, 0xa3, 0x8f, 0xb0, 0xb3, 0xc6, 0xf9, 0xad, 0x70, 0xf5, 0xb4, 0xff, 0x5c,
	0xb8, 0x62, 0xfc, 0xa5, 0x70, 0x45, 0x69, 0x43, 0x83, 0xaf, 0x16, 0x6c, 0xbc, 0xac, 0x10, 0x25,
	0x56, 0x2c, 0x06, 0x9f, 0x16, 0xdc, 0x11, 0x26, 0x92, 0xfd, 0x4b, 0x85, 0x2f, 0x16, 0x5e, 0x4f,
	0xdb, 0x47, 0xe3, 0x16, 0xfd, 0xc3, 0x1e, 0xd0, 0xae, 0x1b, 0x95, 0x33, 0xd6, 0x25, 0x5c, 0x2f,
	0xbe, 0x35, 0xd2, 0x01, 0x78, 0x7a, 0x0d, 0x30, 0xbd, 0xb9, 0x96, 0x3b, 0x61, 0x8d, 0xf7, 0x10,
	0x3c, 0x3d, 0xcc, 0x86, 0xb7, 0x7c, 0x57, 0xbd, 0xdd, 0x5b, 0x31, 0xb1, 0x8f, 0xd8, 0xb7, 0x9b,
	0xbe, 0xf5, 0xe3, 0xa6, 0x6f, 0xfd, 0xbc, 0xe9, 0x5b, 0x9f, 0x6d, 0xe7, 0xe4, 0xf4, 0xed, 0xb9,
	0x47, 0x5b, 0xfa, 0xd1, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb6, 0x0b, 0xf5, 0x3e, 0xb2, 0x05,
	0x00, 0x00,
}
