// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: envoy/extensions/filters/network/thrift_proxy/v2alpha1/thrift_proxy.proto

package v2

import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/lyft/protoc-gen-validate/validate"
import _ "github.com/gogo/protobuf/gogoproto"

import io "io"

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

type ThriftProxy_TransportType int32

const (
	// For every new connection, the Thrift proxy will determine which transport to use.
	AUTO_TRANSPORT ThriftProxy_TransportType = 0
	// The Thrift proxy will assume the client is using the Thrift framed transport.
	FRAMED ThriftProxy_TransportType = 1
	// The Thrift proxy will assume the client is using the Thrift unframed transport.
	UNFRAMED ThriftProxy_TransportType = 2
)

var ThriftProxy_TransportType_name = map[int32]string{
	0: "AUTO_TRANSPORT",
	1: "FRAMED",
	2: "UNFRAMED",
}
var ThriftProxy_TransportType_value = map[string]int32{
	"AUTO_TRANSPORT": 0,
	"FRAMED":         1,
	"UNFRAMED":       2,
}

func (x ThriftProxy_TransportType) String() string {
	return proto.EnumName(ThriftProxy_TransportType_name, int32(x))
}
func (ThriftProxy_TransportType) EnumDescriptor() ([]byte, []int) {
	return fileDescriptorThriftProxy, []int{0, 0}
}

type ThriftProxy_ProtocolType int32

const (
	// For every new connection, the Thrift proxy will determine which protocol to use.
	// N.B. The older, non-strict binary protocol is not included in automatic protocol
	// detection.
	AUTO_PROTOCOL ThriftProxy_ProtocolType = 0
	// The Thrift proxy will assume the client is using the Thrift binary protocol.
	BINARY ThriftProxy_ProtocolType = 1
	// The Thrift proxy will assume the client is using the Thrift non-strict binary protocol.
	LAX_BINARY ThriftProxy_ProtocolType = 2
	// The Thrift proxy will assume the client is using the Thrift compact protocol.
	COMPACT ThriftProxy_ProtocolType = 3
)

var ThriftProxy_ProtocolType_name = map[int32]string{
	0: "AUTO_PROTOCOL",
	1: "BINARY",
	2: "LAX_BINARY",
	3: "COMPACT",
}
var ThriftProxy_ProtocolType_value = map[string]int32{
	"AUTO_PROTOCOL": 0,
	"BINARY":        1,
	"LAX_BINARY":    2,
	"COMPACT":       3,
}

func (x ThriftProxy_ProtocolType) String() string {
	return proto.EnumName(ThriftProxy_ProtocolType_name, int32(x))
}
func (ThriftProxy_ProtocolType) EnumDescriptor() ([]byte, []int) {
	return fileDescriptorThriftProxy, []int{0, 1}
}

// [#protodoc-title: Extensions Thrift Proxy]
// Thrift Proxy filter configuration.
// [#comment:next free field: 5]
type ThriftProxy struct {
	// Supplies the type of transport that the Thrift proxy should use. Defaults to `AUTO_TRANSPORT`.
	Transport ThriftProxy_TransportType `protobuf:"varint,2,opt,name=transport,proto3,enum=envoy.extensions.filters.network.thrift_proxy.v2alpha1.ThriftProxy_TransportType" json:"transport,omitempty"`
	// Supplies the type of protocol that the Thrift proxy should use. Defaults to `AUTO_PROTOCOL`.
	Protocol ThriftProxy_ProtocolType `protobuf:"varint,3,opt,name=protocol,proto3,enum=envoy.extensions.filters.network.thrift_proxy.v2alpha1.ThriftProxy_ProtocolType" json:"protocol,omitempty"`
	// The human readable prefix to use when emitting statistics.
	StatPrefix string `protobuf:"bytes,1,opt,name=stat_prefix,json=statPrefix,proto3" json:"stat_prefix,omitempty"`
	// The route table for the connection manager is static and is specified in this property.
	RouteConfig *RouteConfiguration `protobuf:"bytes,4,opt,name=route_config,json=routeConfig" json:"route_config,omitempty"`
}

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

func (m *ThriftProxy) GetTransport() ThriftProxy_TransportType {
	if m != nil {
		return m.Transport
	}
	return AUTO_TRANSPORT
}

func (m *ThriftProxy) GetProtocol() ThriftProxy_ProtocolType {
	if m != nil {
		return m.Protocol
	}
	return AUTO_PROTOCOL
}

func (m *ThriftProxy) GetStatPrefix() string {
	if m != nil {
		return m.StatPrefix
	}
	return ""
}

func (m *ThriftProxy) GetRouteConfig() *RouteConfiguration {
	if m != nil {
		return m.RouteConfig
	}
	return nil
}

func init() {
	proto.RegisterType((*ThriftProxy)(nil), "envoy.extensions.filters.network.thrift_proxy.v2alpha1.ThriftProxy")
	proto.RegisterEnum("envoy.extensions.filters.network.thrift_proxy.v2alpha1.ThriftProxy_TransportType", ThriftProxy_TransportType_name, ThriftProxy_TransportType_value)
	proto.RegisterEnum("envoy.extensions.filters.network.thrift_proxy.v2alpha1.ThriftProxy_ProtocolType", ThriftProxy_ProtocolType_name, ThriftProxy_ProtocolType_value)
}
func (m *ThriftProxy) 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 *ThriftProxy) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if len(m.StatPrefix) > 0 {
		dAtA[i] = 0xa
		i++
		i = encodeVarintThriftProxy(dAtA, i, uint64(len(m.StatPrefix)))
		i += copy(dAtA[i:], m.StatPrefix)
	}
	if m.Transport != 0 {
		dAtA[i] = 0x10
		i++
		i = encodeVarintThriftProxy(dAtA, i, uint64(m.Transport))
	}
	if m.Protocol != 0 {
		dAtA[i] = 0x18
		i++
		i = encodeVarintThriftProxy(dAtA, i, uint64(m.Protocol))
	}
	if m.RouteConfig != nil {
		dAtA[i] = 0x22
		i++
		i = encodeVarintThriftProxy(dAtA, i, uint64(m.RouteConfig.Size()))
		n1, err := m.RouteConfig.MarshalTo(dAtA[i:])
		if err != nil {
			return 0, err
		}
		i += n1
	}
	return i, nil
}

func encodeVarintThriftProxy(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 *ThriftProxy) Size() (n int) {
	var l int
	_ = l
	l = len(m.StatPrefix)
	if l > 0 {
		n += 1 + l + sovThriftProxy(uint64(l))
	}
	if m.Transport != 0 {
		n += 1 + sovThriftProxy(uint64(m.Transport))
	}
	if m.Protocol != 0 {
		n += 1 + sovThriftProxy(uint64(m.Protocol))
	}
	if m.RouteConfig != nil {
		l = m.RouteConfig.Size()
		n += 1 + l + sovThriftProxy(uint64(l))
	}
	return n
}

func sovThriftProxy(x uint64) (n int) {
	for {
		n++
		x >>= 7
		if x == 0 {
			break
		}
	}
	return n
}
func sozThriftProxy(x uint64) (n int) {
	return sovThriftProxy(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *ThriftProxy) 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 ErrIntOverflowThriftProxy
			}
			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: ThriftProxy: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: ThriftProxy: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field StatPrefix", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowThriftProxy
				}
				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 ErrInvalidLengthThriftProxy
			}
			postIndex := iNdEx + intStringLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.StatPrefix = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Transport", wireType)
			}
			m.Transport = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowThriftProxy
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Transport |= (ThriftProxy_TransportType(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 3:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType)
			}
			m.Protocol = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowThriftProxy
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Protocol |= (ThriftProxy_ProtocolType(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 4:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field RouteConfig", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowThriftProxy
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthThriftProxy
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.RouteConfig == nil {
				m.RouteConfig = &RouteConfiguration{}
			}
			if err := m.RouteConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipThriftProxy(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthThriftProxy
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func skipThriftProxy(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, ErrIntOverflowThriftProxy
			}
			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, ErrIntOverflowThriftProxy
				}
				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, ErrIntOverflowThriftProxy
				}
				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, ErrInvalidLengthThriftProxy
			}
			return iNdEx, nil
		case 3:
			for {
				var innerWire uint64
				var start int = iNdEx
				for shift := uint(0); ; shift += 7 {
					if shift >= 64 {
						return 0, ErrIntOverflowThriftProxy
					}
					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 := skipThriftProxy(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 (
	ErrInvalidLengthThriftProxy = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowThriftProxy   = fmt.Errorf("proto: integer overflow")
)

func init() {
	proto.RegisterFile("envoy/extensions/filters/network/thrift_proxy/v2alpha1/thrift_proxy.proto", fileDescriptorThriftProxy)
}

var fileDescriptorThriftProxy = []byte{
	// 430 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x90, 0x31, 0x8f, 0xd3, 0x30,
	0x14, 0xc7, 0xcf, 0x69, 0x39, 0xae, 0x2f, 0xbd, 0x2a, 0x58, 0x48, 0x54, 0x1d, 0xaa, 0xaa, 0x53,
	0xc5, 0xe0, 0x88, 0x22, 0xb1, 0x27, 0x01, 0xa4, 0x43, 0x77, 0x8d, 0x31, 0x3e, 0x09, 0x58, 0xaa,
	0x70, 0xb8, 0xbd, 0x88, 0x10, 0x47, 0x8e, 0x2f, 0xa4, 0x62, 0x63, 0xe2, 0x7b, 0xf0, 0x1d, 0x18,
	0x98, 0x18, 0x19, 0xf9, 0x08, 0xa8, 0x1b, 0xdf, 0x02, 0xc5, 0x49, 0x69, 0x2b, 0xb6, 0x8a, 0xed,
	0xf9, 0x3d, 0xf9, 0xf7, 0x7b, 0xef, 0x0f, 0x67, 0x22, 0x2d, 0xe4, 0xca, 0x15, 0xa5, 0x16, 0x69,
	0x1e, 0xcb, 0x34, 0x77, 0x17, 0x71, 0xa2, 0x85, 0xca, 0xdd, 0x54, 0xe8, 0x0f, 0x52, 0xbd, 0x73,
	0xf5, 0xb5, 0x8a, 0x17, 0x7a, 0x9e, 0x29, 0x59, 0xae, 0xdc, 0x62, 0x1a, 0x25, 0xd9, 0x75, 0xf4,
	0x60, 0xaf, 0x4b, 0x32, 0x25, 0xb5, 0xc4,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