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

package dataRetriever

import (
	bytes "bytes"
	fmt "fmt"
	_ "github.com/gogo/protobuf/gogoproto"
	proto "github.com/gogo/protobuf/proto"
	io "io"
	math "math"
	math_bits "math/bits"
	reflect "reflect"
	strconv "strconv"
	strings "strings"
)

// 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

// RequestDataType represents the data type for the requested data
type RequestDataType int32

const (
	// Invalid
	InvalidType RequestDataType = 0
	// HashType indicates that the request data object is of type hash
	HashType RequestDataType = 1
	// HashArrayType that the request data object contains a serialised array of hashes
	HashArrayType RequestDataType = 2
	// NonceType indicates that the request data object is of type nonce (uint64)
	NonceType RequestDataType = 3
	// EpochType indicates that the request data object is of type epoch
	EpochType RequestDataType = 4
)

var RequestDataType_name = map[int32]string{
	0: "InvalidType",
	1: "HashType",
	2: "HashArrayType",
	3: "NonceType",
	4: "EpochType",
}

var RequestDataType_value = map[string]int32{
	"InvalidType":   0,
	"HashType":      1,
	"HashArrayType": 2,
	"NonceType":     3,
	"EpochType":     4,
}

func (RequestDataType) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_d2e280b7501d5666, []int{0}
}

// RequestData holds the requested data
// This struct will be serialized and sent to the other peers
type RequestData struct {
	Type       RequestDataType `protobuf:"varint,1,opt,name=Type,proto3,enum=proto.RequestDataType" json:"type"`
	Value      []byte          `protobuf:"bytes,2,opt,name=Value,proto3" json:"value"`
	Epoch      uint32          `protobuf:"varint,3,opt,name=Epoch,proto3" json:"epoch"`
	ChunkIndex uint32          `protobuf:"varint,4,opt,name=ChunkIndex,proto3" json:"chunkIndex"`
}

func (m *RequestData) Reset()      { *m = RequestData{} }
func (*RequestData) ProtoMessage() {}
func (*RequestData) Descriptor() ([]byte, []int) {
	return fileDescriptor_d2e280b7501d5666, []int{0}
}
func (m *RequestData) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *RequestData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	b = b[:cap(b)]
	n, err := m.MarshalToSizedBuffer(b)
	if err != nil {
		return nil, err
	}
	return b[:n], nil
}
func (m *RequestData) XXX_Merge(src proto.Message) {
	xxx_messageInfo_RequestData.Merge(m, src)
}
func (m *RequestData) XXX_Size() int {
	return m.Size()
}
func (m *RequestData) XXX_DiscardUnknown() {
	xxx_messageInfo_RequestData.DiscardUnknown(m)
}

var xxx_messageInfo_RequestData proto.InternalMessageInfo

func (m *RequestData) GetType() RequestDataType {
	if m != nil {
		return m.Type
	}
	return InvalidType
}

func (m *RequestData) GetValue() []byte {
	if m != nil {
		return m.Value
	}
	return nil
}

func (m *RequestData) GetEpoch() uint32 {
	if m != nil {
		return m.Epoch
	}
	return 0
}

func (m *RequestData) GetChunkIndex() uint32 {
	if m != nil {
		return m.ChunkIndex
	}
	return 0
}

func init() {
	proto.RegisterEnum("proto.RequestDataType", RequestDataType_name, RequestDataType_value)
	proto.RegisterType((*RequestData)(nil), "proto.RequestData")
}

func init() { proto.RegisterFile("requestData.proto", fileDescriptor_d2e280b7501d5666) }

var fileDescriptor_d2e280b7501d5666 = []byte{
	// 337 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x90, 0x41, 0x4e, 0x2a, 0x31,
	0x18, 0x80, 0xe7, 0x87, 0xe1, 0x05, 0x0a, 0x03, 0x8f, 0x2e, 0x5e, 0x26, 0x6f, 0xf1, 0x0f, 0x71,
	0x45, 0x4c, 0x1c, 0x12, 0xf5, 0x02, 0xa2, 0x46, 0xd9, 0xb8, 0x98, 0x18, 0x17, 0xee, 0xca, 0x50,
	0x19, 0x22, 0x4e, 0xc7, 0xa1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, 0xad, 0x91, 0xf2, 0x25, 0x9b,
	0x44, 0x86, 0x80, 0x36, 0x89, 0xa3, 0xe9, 0x24, 0x4d, 0xd9, 0xcc, 0xa8, 0x02, 0x75, 0x48, 0xe5,
	0x4a, 0xc4, 0x21, 0x37, 0x58, 0xd4, 0x68, 0x86, 0x31, 0x68, 0x77, 0x2f, 0xe6, 0x2b, 0xb4, 0x16,
	0x2b, 0xb4, 0xb6, 0x2b, 0x84, 0x67, 0x85, 0xf0, 0xaa, 0x10, 0xde, 0x15, 0xc2, 0x5c, 0x21, 0x2c,
	0x14, 0xc2, 0x87, 0x42, 0xf8, 0x54, 0x68, 0x6d, 0x15, 0xc2, 0xcb, 0x1a, 0xad, 0xf9, 0x1a, 0xad,
	0xc5, 0x1a, 0xad, 0x5b, 0x67, 0xc0, 0x24, 0x0b, 0xb8, 0x4c, 0x47, 0x7c, 0xca, 0xd3, 0xfe, 0x1f,
	0xf3, 0x89, 0x47, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x8e, 0xe6, 0x8e, 0x2d, 0xb5, 0x01, 0x00,
	0x00,
}

func (x RequestDataType) String() string {
	s, ok := RequestDataType_name[int32(x)]
	if ok {
		return s
	}
	return strconv.Itoa(int(x))
}
func (this *RequestData) Equal(that interface{}) bool {
	if that == nil {
		return this == nil
	}

	that1, ok := that.(*RequestData)
	if !ok {
		that2, ok := that.(RequestData)
		if ok {
			that1 = &that2
		} else {
			return false
		}
	}
	if that1 == nil {
		return this == nil
	} else if this == nil {
		return false
	}
	if this.Type != that1.Type {
		return false
	}
	if !bytes.Equal(this.Value, that1.Value) {
		return false
	}
	if this.Epoch != that1.Epoch {
		return false
	}
	if this.ChunkIndex != that1.ChunkIndex {
		return false
	}
	return true
}
func (this *RequestData) GoString() string {
	if this == nil {
		return "nil"
	}
	s := make([]string, 0, 8)
	s = append(s, "&dataRetriever.RequestData{")
	s = append(s, "Type: "+fmt.Sprintf("%#v", this.Type)+",\n")
	s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n")
	s = append(s, "Epoch: "+fmt.Sprintf("%#v", this.Epoch)+",\n")
	s = append(s, "ChunkIndex: "+fmt.Sprintf("%#v", this.ChunkIndex)+",\n")
	s = append(s, "}")
	return strings.Join(s, "")
}
func valueToGoStringRequestData(v interface{}, typ string) string {
	rv := reflect.ValueOf(v)
	if rv.IsNil() {
		return "nil"
	}
	pv := reflect.Indirect(rv).Interface()
	return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
}
func (m *RequestData) 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 *RequestData) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *RequestData) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.ChunkIndex != 0 {
		i = encodeVarintRequestData(dAtA, i, uint64(m.ChunkIndex))
		i--
		dAtA[i] = 0x20
	}
	if m.Epoch != 0 {
		i = encodeVarintRequestData(dAtA, i, uint64(m.Epoch))
		i--
		dAtA[i] = 0x18
	}
	if len(m.Value) > 0 {
		i -= len(m.Value)
		copy(dAtA[i:], m.Value)
		i = encodeVarintRequestData(dAtA, i, uint64(len(m.Value)))
		i--
		dAtA[i] = 0x12
	}
	if m.Type != 0 {
		i = encodeVarintRequestData(dAtA, i, uint64(m.Type))
		i--
		dAtA[i] = 0x8
	}
	return len(dAtA) - i, nil
}

func encodeVarintRequestData(dAtA []byte, offset int, v uint64) int {
	offset -= sovRequestData(v)
	base := offset
	for v >= 1<<7 {
		dAtA[offset] = uint8(v&0x7f | 0x80)
		v >>= 7
		offset++
	}
	dAtA[offset] = uint8(v)
	return base
}
func (m *RequestData) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Type != 0 {
		n += 1 + sovRequestData(uint64(m.Type))
	}
	l = len(m.Value)
	if l > 0 {
		n += 1 + l + sovRequestData(uint64(l))
	}
	if m.Epoch != 0 {
		n += 1 + sovRequestData(uint64(m.Epoch))
	}
	if m.ChunkIndex != 0 {
		n += 1 + sovRequestData(uint64(m.ChunkIndex))
	}
	return n
}

func sovRequestData(x uint64) (n int) {
	return (math_bits.Len64(x|1) + 6) / 7
}
func sozRequestData(x uint64) (n int) {
	return sovRequestData(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (this *RequestData) String() string {
	if this == nil {
		return "nil"
	}
	s := strings.Join([]string{`&RequestData{`,
		`Type:` + fmt.Sprintf("%v", this.Type) + `,`,
		`Value:` + fmt.Sprintf("%v", this.Value) + `,`,
		`Epoch:` + fmt.Sprintf("%v", this.Epoch) + `,`,
		`ChunkIndex:` + fmt.Sprintf("%v", this.ChunkIndex) + `,`,
		`}`,
	}, "")
	return s
}
func valueToStringRequestData(v interface{}) string {
	rv := reflect.ValueOf(v)
	if rv.IsNil() {
		return "nil"
	}
	pv := reflect.Indirect(rv).Interface()
	return fmt.Sprintf("*%v", pv)
}
func (m *RequestData) 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 ErrIntOverflowRequestData
			}
			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: RequestData: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: RequestData: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
			}
			m.Type = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRequestData
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Type |= RequestDataType(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
			}
			var byteLen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRequestData
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				byteLen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if byteLen < 0 {
				return ErrInvalidLengthRequestData
			}
			postIndex := iNdEx + byteLen
			if postIndex < 0 {
				return ErrInvalidLengthRequestData
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...)
			if m.Value == nil {
				m.Value = []byte{}
			}
			iNdEx = postIndex
		case 3:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Epoch", wireType)
			}
			m.Epoch = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRequestData
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Epoch |= uint32(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 4:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field ChunkIndex", wireType)
			}
			m.ChunkIndex = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRequestData
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.ChunkIndex |= uint32(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		default:
			iNdEx = preIndex
			skippy, err := skipRequestData(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthRequestData
			}
			if (iNdEx + skippy) < 0 {
				return ErrInvalidLengthRequestData
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func skipRequestData(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, ErrIntOverflowRequestData
			}
			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, ErrIntOverflowRequestData
				}
				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, ErrIntOverflowRequestData
				}
				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, ErrInvalidLengthRequestData
			}
			iNdEx += length
		case 3:
			depth++
		case 4:
			if depth == 0 {
				return 0, ErrUnexpectedEndOfGroupRequestData
			}
			depth--
		case 5:
			iNdEx += 4
		default:
			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
		}
		if iNdEx < 0 {
			return 0, ErrInvalidLengthRequestData
		}
		if depth == 0 {
			return iNdEx, nil
		}
	}
	return 0, io.ErrUnexpectedEOF
}

var (
	ErrInvalidLengthRequestData        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowRequestData          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupRequestData = fmt.Errorf("proto: unexpected end of group")
)
