package discpb

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

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

var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

const _ = proto.ProtoPackageIsVersion2 

type DiscoverRequest struct {
}

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

type DiscoverResponse struct {
	Shards []*Shard `protobuf:"bytes,1,rep,name=shards" json:"shards,omitempty"`
}

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

func (m *DiscoverResponse) GetShards() []*Shard {
	if m != nil {
		return m.Shards
	}
	return nil
}

type Shard struct {
	ShardID int32         `protobuf:"varint,1,opt,name=shardID" json:"shardID,omitempty"`
	Servers []*DataServer `protobuf:"bytes,2,rep,name=servers" json:"servers,omitempty"`
}

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

func (m *Shard) GetShardID() int32 {
	if m != nil {
		return m.ShardID
	}
	return 0
}

func (m *Shard) GetServers() []*DataServer {
	if m != nil {
		return m.Servers
	}
	return nil
}

type DataServer struct {
	ServerID int32  `protobuf:"varint,1,opt,name=serverID" json:"serverID,omitempty"`
	Port     int32  `protobuf:"varint,2,opt,name=port" json:"port,omitempty"`
	Ip       string `protobuf:"bytes,3,opt,name=ip" json:"ip,omitempty"`
}

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

func (m *DataServer) GetServerID() int32 {
	if m != nil {
		return m.ServerID
	}
	return 0
}

func (m *DataServer) GetPort() int32 {
	if m != nil {
		return m.Port
	}
	return 0
}

func (m *DataServer) GetIp() string {
	if m != nil {
		return m.Ip
	}
	return ""
}

func init() {
	proto.RegisterType((*DiscoverRequest)(nil), "discpb.DiscoverRequest")
	proto.RegisterType((*DiscoverResponse)(nil), "discpb.DiscoverResponse")
	proto.RegisterType((*Shard)(nil), "discpb.Shard")
	proto.RegisterType((*DataServer)(nil), "discpb.DataServer")
}

var _ context.Context
var _ grpc.ClientConn

const _ = grpc.SupportPackageIsVersion4

type DiscoveryClient interface {
	DiscoverServers(ctx context.Context, in *DiscoverRequest, opts ...grpc.CallOption) (*DiscoverResponse, error)
}

type discoveryClient struct {
	cc *grpc.ClientConn
}

func NewDiscoveryClient(cc *grpc.ClientConn) DiscoveryClient {
	return &discoveryClient{cc}
}

func (c *discoveryClient) DiscoverServers(ctx context.Context, in *DiscoverRequest, opts ...grpc.CallOption) (*DiscoverResponse, error) {
	out := new(DiscoverResponse)
	err := grpc.Invoke(ctx, "/discpb.Discovery/DiscoverServers", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

type DiscoveryServer interface {
	DiscoverServers(context.Context, *DiscoverRequest) (*DiscoverResponse, error)
}

func RegisterDiscoveryServer(s *grpc.Server, srv DiscoveryServer) {
	s.RegisterService(&_Discovery_serviceDesc, srv)
}

func _Discovery_DiscoverServers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DiscoverRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DiscoveryServer).DiscoverServers(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/discpb.Discovery/DiscoverServers",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DiscoveryServer).DiscoverServers(ctx, req.(*DiscoverRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _Discovery_serviceDesc = grpc.ServiceDesc{
	ServiceName: "discpb.Discovery",
	HandlerType: (*DiscoveryServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "DiscoverServers",
			Handler:    _Discovery_DiscoverServers_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "discpb/discovery.proto",
}

func init() { proto.RegisterFile("discpb/discovery.proto", fileDescriptor0) }

var fileDescriptor0 = []byte{

	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x64, 0x90, 0x4d, 0x4b, 0xc4, 0x30,
	0x10, 0x86, 0x4d, 0xd6, 0xed, 0xba, 0x23, 0x7e, 0xcd, 0x41, 0xc3, 0x9e, 0x4a, 0x40, 0xe8, 0x41,
	0x2a, 0xac, 0x27, 0xef, 0x45, 0x10, 0x04, 0x21, 0xfd, 0x05, 0xad, 0x0d, 0xd8, 0x8b, 0x89, 0x99,
	0x58, 0xe8, 0xbf, 0x97, 0x26, 0x4d, 0x8b, 0x78, 0x6a, 0xe7, 0x79, 0x92, 0x97, 0xcc, 0x0b, 0xb7,
	0x5d, 0x4f, 0x1f, 0xb6, 0x7d, 0x9c, 0x3e, 0x66, 0xd0, 0x6e, 0x2c, 0xad, 0x33, 0xde, 0x60, 0x16,
	0xb9, 0xbc, 0x81, 0xab, 0x6a, 0x56, 0x4a, 0x7f, 0xff, 0x68, 0xf2, 0xf2, 0x19, 0xae, 0x57, 0x44,
	0xd6, 0x7c, 0x91, 0xc6, 0x7b, 0xc8, 0xe8, 0xb3, 0x71, 0x1d, 0x09, 0x96, 0x6f, 0x8a, 0xf3, 0xe3,
	0x45, 0x19, 0xef, 0x97, 0xf5, 0x44, 0xd5, 0x2c, 0xe5, 0x3b, 0x6c, 0x03, 0x40, 0x01, 0xbb, 0x80,
	0x5e, 0x2b, 0xc1, 0x72, 0x56, 0x6c, 0x55, 0x1a, 0xf1, 0x01, 0x76, 0xa4, 0xdd, 0xa0, 0x1d, 0x09,
	0x1e, 0xa2, 0x30, 0x45, 0x55, 0x8d, 0x6f, 0xea, 0xa0, 0x54, 0x3a, 0x22, 0xdf, 0x00, 0x56, 0x8c,
	0x07, 0x38, 0x8b, 0x62, 0x89, 0x5d, 0x66, 0x44, 0x38, 0xb5, 0xc6, 0x79, 0xc1, 0x03, 0x0f, 0xff,
	0x78, 0x09, 0xbc, 0xb7, 0x62, 0x93, 0xb3, 0x62, 0xaf, 0x78, 0x6f, 0x8f, 0x35, 0xec, 0xd3, 0x66,
	0x23, 0xbe, 0xac, 0x9b, 0xc7, 0x78, 0xc2, 0xbb, 0xe5, 0x29, 0x7f, 0x2b, 0x39, 0x88, 0xff, 0x22,
	0x16, 0x23, 0x4f, 0xda, 0x2c, 0x14, 0xfa, 0xf4, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xda, 0xf9, 0xef,
	0x0f, 0x6a, 0x01, 0x00, 0x00,
}
// Code generated by protoc-gen-go.
// source: discpb/discovery.proto
// DO NOT EDIT!

/*
Package discpb is a generated protocol buffer package.

It is generated from these files:
	discpb/discovery.proto

It has these top-level messages:
	DiscoverRequest
	DiscoverResponse
	Shard
	DataServer
*/
package discpb

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

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 DiscoverRequest struct {
}

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

type DiscoverResponse struct {
	Shards []*Shard `protobuf:"bytes,1,rep,name=shards" json:"shards,omitempty"`
}

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

func (m *DiscoverResponse) GetShards() []*Shard {
	if m != nil {
		return m.Shards
	}
	return nil
}

type Shard struct {
	ShardID int32         `protobuf:"varint,1,opt,name=shardID" json:"shardID,omitempty"`
	Servers []*DataServer `protobuf:"bytes,2,rep,name=servers" json:"servers,omitempty"`
}

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

func (m *Shard) GetShardID() int32 {
	if m != nil {
		return m.ShardID
	}
	return 0
}

func (m *Shard) GetServers() []*DataServer {
	if m != nil {
		return m.Servers
	}
	return nil
}

type DataServer struct {
	ServerID int32  `protobuf:"varint,1,opt,name=serverID" json:"serverID,omitempty"`
	Port     int32  `protobuf:"varint,2,opt,name=port" json:"port,omitempty"`
	Ip       string `protobuf:"bytes,3,opt,name=ip" json:"ip,omitempty"`
}

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

func (m *DataServer) GetServerID() int32 {
	if m != nil {
		return m.ServerID
	}
	return 0
}

func (m *DataServer) GetPort() int32 {
	if m != nil {
		return m.Port
	}
	return 0
}

func (m *DataServer) GetIp() string {
	if m != nil {
		return m.Ip
	}
	return ""
}

func init() {
	proto.RegisterType((*DiscoverRequest)(nil), "discpb.DiscoverRequest")
	proto.RegisterType((*DiscoverResponse)(nil), "discpb.DiscoverResponse")
	proto.RegisterType((*Shard)(nil), "discpb.Shard")
	proto.RegisterType((*DataServer)(nil), "discpb.DataServer")
}

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

type DiscoveryClient interface {
	DiscoverServers(ctx context.Context, in *DiscoverRequest, opts ...grpc.CallOption) (*DiscoverResponse, error)
}

type discoveryClient struct {
	cc *grpc.ClientConn
}

func NewDiscoveryClient(cc *grpc.ClientConn) DiscoveryClient {
	return &discoveryClient{cc}
}

func (c *discoveryClient) DiscoverServers(ctx context.Context, in *DiscoverRequest, opts ...grpc.CallOption) (*DiscoverResponse, error) {
	out := new(DiscoverResponse)
	err := grpc.Invoke(ctx, "/discpb.Discovery/DiscoverServers", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// Server API for Discovery service

type DiscoveryServer interface {
	DiscoverServers(context.Context, *DiscoverRequest) (*DiscoverResponse, error)
}

func RegisterDiscoveryServer(s *grpc.Server, srv DiscoveryServer) {
	s.RegisterService(&_Discovery_serviceDesc, srv)
}

func _Discovery_DiscoverServers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DiscoverRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DiscoveryServer).DiscoverServers(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/discpb.Discovery/DiscoverServers",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DiscoveryServer).DiscoverServers(ctx, req.(*DiscoverRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _Discovery_serviceDesc = grpc.ServiceDesc{
	ServiceName: "discpb.Discovery",
	HandlerType: (*DiscoveryServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "DiscoverServers",
			Handler:    _Discovery_DiscoverServers_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "discpb/discovery.proto",
}

func init() { proto.RegisterFile("discpb/discovery.proto", fileDescriptor0) }

var fileDescriptor0 = []byte{
	// 229 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x64, 0x90, 0x4d, 0x4b, 0xc4, 0x30,
	0x10, 0x86, 0x4d, 0xd6, 0xed, 0xba, 0x23, 0x7e, 0xcd, 0x41, 0xc3, 0x9e, 0x4a, 0x40, 0xe8, 0x41,
	0x2a, 0xac, 0x27, 0xef, 0x45, 0x10, 0x04, 0x21, 0xfd, 0x05, 0xad, 0x0d, 0xd8, 0x8b, 0x89, 0x99,
	0x58, 0xe8, 0xbf, 0x97, 0x26, 0x4d, 0x8b, 0x78, 0x6a, 0xe7, 0x79, 0x92, 0x97, 0xcc, 0x0b, 0xb7,
	0x5d, 0x4f, 0x1f, 0xb6, 0x7d, 0x9c, 0x3e, 0x66, 0xd0, 0x6e, 0x2c, 0xad, 0x33, 0xde, 0x60, 0x16,
	0xb9, 0xbc, 0x81, 0xab, 0x6a, 0x56, 0x4a, 0x7f, 0xff, 0x68, 0xf2, 0xf2, 0x19, 0xae, 0x57, 0x44,
	0xd6, 0x7c, 0x91, 0xc6, 0x7b, 0xc8, 0xe8, 0xb3, 0x71, 0x1d, 0x09, 0x96, 0x6f, 0x8a, 0xf3, 0xe3,
	0x45, 0x19, 0xef, 0x97, 0xf5, 0x44, 0xd5, 0x2c, 0xe5, 0x3b, 0x6c, 0x03, 0x40, 0x01, 0xbb, 0x80,
	0x5e, 0x2b, 0xc1, 0x72, 0x56, 0x6c, 0x55, 0x1a, 0xf1, 0x01, 0x76, 0xa4, 0xdd, 0xa0, 0x1d, 0x09,
	0x1e, 0xa2, 0x30, 0x45, 0x55, 0x8d, 0x6f, 0xea, 0xa0, 0x54, 0x3a, 0x22, 0xdf, 0x00, 0x56, 0x8c,
	0x07, 0x38, 0x8b, 0x62, 0x89, 0x5d, 0x66, 0x44, 0x38, 0xb5, 0xc6, 0x79, 0xc1, 0x03, 0x0f, 0xff,
	0x78, 0x09, 0xbc, 0xb7, 0x62, 0x93, 0xb3, 0x62, 0xaf, 0x78, 0x6f, 0x8f, 0x35, 0xec, 0xd3, 0x66,
	0x23, 0xbe, 0xac, 0x9b, 0xc7, 0x78, 0xc2, 0xbb, 0xe5, 0x29, 0x7f, 0x2b, 0x39, 0x88, 0xff, 0x22,
	0x16, 0x23, 0x4f, 0xda, 0x2c, 0x14, 0xfa, 0xf4, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xda, 0xf9, 0xef,
	0x0f, 0x6a, 0x01, 0x00, 0x00,
}
