// Code generated by protoc-gen-go. DO NOT EDIT.
// source: proxy/destination/destination.proto

/*
Package conduit_proxy_destination is a generated protocol buffer package.

It is generated from these files:
	proxy/destination/destination.proto

It has these top-level messages:
	Update
	AddrSet
	WeightedAddrSet
	WeightedAddr
	NoEndpoints
*/
package conduit_proxy_destination

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import conduit_common "github.com/runconduit/conduit/controller/gen/common"

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

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

type Update struct {
	// Types that are valid to be assigned to Update:
	//	*Update_Add
	//	*Update_Remove
	//	*Update_NoEndpoints
	Update isUpdate_Update `protobuf_oneof:"update"`
}

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

type isUpdate_Update interface{ isUpdate_Update() }

type Update_Add struct {
	Add *WeightedAddrSet `protobuf:"bytes,1,opt,name=add,oneof"`
}
type Update_Remove struct {
	Remove *AddrSet `protobuf:"bytes,2,opt,name=remove,oneof"`
}
type Update_NoEndpoints struct {
	NoEndpoints *NoEndpoints `protobuf:"bytes,3,opt,name=no_endpoints,json=noEndpoints,oneof"`
}

func (*Update_Add) isUpdate_Update()         {}
func (*Update_Remove) isUpdate_Update()      {}
func (*Update_NoEndpoints) isUpdate_Update() {}

func (m *Update) GetUpdate() isUpdate_Update {
	if m != nil {
		return m.Update
	}
	return nil
}

func (m *Update) GetAdd() *WeightedAddrSet {
	if x, ok := m.GetUpdate().(*Update_Add); ok {
		return x.Add
	}
	return nil
}

func (m *Update) GetRemove() *AddrSet {
	if x, ok := m.GetUpdate().(*Update_Remove); ok {
		return x.Remove
	}
	return nil
}

func (m *Update) GetNoEndpoints() *NoEndpoints {
	if x, ok := m.GetUpdate().(*Update_NoEndpoints); ok {
		return x.NoEndpoints
	}
	return nil
}

// XXX_OneofFuncs is for the internal use of the proto package.
func (*Update) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
	return _Update_OneofMarshaler, _Update_OneofUnmarshaler, _Update_OneofSizer, []interface{}{
		(*Update_Add)(nil),
		(*Update_Remove)(nil),
		(*Update_NoEndpoints)(nil),
	}
}

func _Update_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
	m := msg.(*Update)
	// update
	switch x := m.Update.(type) {
	case *Update_Add:
		b.EncodeVarint(1<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.Add); err != nil {
			return err
		}
	case *Update_Remove:
		b.EncodeVarint(2<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.Remove); err != nil {
			return err
		}
	case *Update_NoEndpoints:
		b.EncodeVarint(3<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.NoEndpoints); err != nil {
			return err
		}
	case nil:
	default:
		return fmt.Errorf("Update.Update has unexpected type %T", x)
	}
	return nil
}

func _Update_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
	m := msg.(*Update)
	switch tag {
	case 1: // update.add
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(WeightedAddrSet)
		err := b.DecodeMessage(msg)
		m.Update = &Update_Add{msg}
		return true, err
	case 2: // update.remove
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(AddrSet)
		err := b.DecodeMessage(msg)
		m.Update = &Update_Remove{msg}
		return true, err
	case 3: // update.no_endpoints
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(NoEndpoints)
		err := b.DecodeMessage(msg)
		m.Update = &Update_NoEndpoints{msg}
		return true, err
	default:
		return false, nil
	}
}

func _Update_OneofSizer(msg proto.Message) (n int) {
	m := msg.(*Update)
	// update
	switch x := m.Update.(type) {
	case *Update_Add:
		s := proto.Size(x.Add)
		n += proto.SizeVarint(1<<3 | proto.WireBytes)
		n += proto.SizeVarint(uint64(s))
		n += s
	case *Update_Remove:
		s := proto.Size(x.Remove)
		n += proto.SizeVarint(2<<3 | proto.WireBytes)
		n += proto.SizeVarint(uint64(s))
		n += s
	case *Update_NoEndpoints:
		s := proto.Size(x.NoEndpoints)
		n += proto.SizeVarint(3<<3 | proto.WireBytes)
		n += proto.SizeVarint(uint64(s))
		n += s
	case nil:
	default:
		panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
	}
	return n
}

type AddrSet struct {
	Addrs []*conduit_common.TcpAddress `protobuf:"bytes,1,rep,name=addrs" json:"addrs,omitempty"`
}

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

func (m *AddrSet) GetAddrs() []*conduit_common.TcpAddress {
	if m != nil {
		return m.Addrs
	}
	return nil
}

type WeightedAddrSet struct {
	Addrs []*WeightedAddr `protobuf:"bytes,1,rep,name=addrs" json:"addrs,omitempty"`
}

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

func (m *WeightedAddrSet) GetAddrs() []*WeightedAddr {
	if m != nil {
		return m.Addrs
	}
	return nil
}

type WeightedAddr struct {
	Addr   *conduit_common.TcpAddress `protobuf:"bytes,1,opt,name=addr" json:"addr,omitempty"`
	Weight uint32                     `protobuf:"varint,3,opt,name=weight" json:"weight,omitempty"`
}

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

func (m *WeightedAddr) GetAddr() *conduit_common.TcpAddress {
	if m != nil {
		return m.Addr
	}
	return nil
}

func (m *WeightedAddr) GetWeight() uint32 {
	if m != nil {
		return m.Weight
	}
	return 0
}

type NoEndpoints struct {
	Exists bool `protobuf:"varint,1,opt,name=exists" json:"exists,omitempty"`
}

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

func (m *NoEndpoints) GetExists() bool {
	if m != nil {
		return m.Exists
	}
	return false
}

func init() {
	proto.RegisterType((*Update)(nil), "conduit.proxy.destination.Update")
	proto.RegisterType((*AddrSet)(nil), "conduit.proxy.destination.AddrSet")
	proto.RegisterType((*WeightedAddrSet)(nil), "conduit.proxy.destination.WeightedAddrSet")
	proto.RegisterType((*WeightedAddr)(nil), "conduit.proxy.destination.WeightedAddr")
	proto.RegisterType((*NoEndpoints)(nil), "conduit.proxy.destination.NoEndpoints")
}

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

type DestinationClient interface {
	// Given a destination, return all addresses in that destination as a long-
	// running stream of updates.
	Get(ctx context.Context, in *conduit_common.Destination, opts ...grpc.CallOption) (Destination_GetClient, error)
}

type destinationClient struct {
	cc *grpc.ClientConn
}

func NewDestinationClient(cc *grpc.ClientConn) DestinationClient {
	return &destinationClient{cc}
}

func (c *destinationClient) Get(ctx context.Context, in *conduit_common.Destination, opts ...grpc.CallOption) (Destination_GetClient, error) {
	stream, err := grpc.NewClientStream(ctx, &_Destination_serviceDesc.Streams[0], c.cc, "/conduit.proxy.destination.Destination/Get", opts...)
	if err != nil {
		return nil, err
	}
	x := &destinationGetClient{stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

type Destination_GetClient interface {
	Recv() (*Update, error)
	grpc.ClientStream
}

type destinationGetClient struct {
	grpc.ClientStream
}

func (x *destinationGetClient) Recv() (*Update, error) {
	m := new(Update)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// Server API for Destination service

type DestinationServer interface {
	// Given a destination, return all addresses in that destination as a long-
	// running stream of updates.
	Get(*conduit_common.Destination, Destination_GetServer) error
}

func RegisterDestinationServer(s *grpc.Server, srv DestinationServer) {
	s.RegisterService(&_Destination_serviceDesc, srv)
}

func _Destination_Get_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(conduit_common.Destination)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(DestinationServer).Get(m, &destinationGetServer{stream})
}

type Destination_GetServer interface {
	Send(*Update) error
	grpc.ServerStream
}

type destinationGetServer struct {
	grpc.ServerStream
}

func (x *destinationGetServer) Send(m *Update) error {
	return x.ServerStream.SendMsg(m)
}

var _Destination_serviceDesc = grpc.ServiceDesc{
	ServiceName: "conduit.proxy.destination.Destination",
	HandlerType: (*DestinationServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Get",
			Handler:       _Destination_Get_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "proxy/destination/destination.proto",
}

func init() { proto.RegisterFile("proxy/destination/destination.proto", fileDescriptor0) }

var fileDescriptor0 = []byte{
	// 327 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 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