// Code generated by protoc-gen-go.
// source: examples/rpcbench2/echo.proto
// DO NOT EDIT!

/*
Package echo is a generated protocol buffer package.

It is generated from these files:
	examples/rpcbench2/echo.proto

It has these top-level messages:
	EchoRequest
	EchoResponse
*/
package echo

import proto "code.google.com/p/goprotobuf/proto"
import json "encoding/json"
import math "math"

// RPC Imports
import "io"
import "net/rpc"
import "github.com/chenshuo/muduo-protorpc/go/muduorpc"

// Reference proto, json, and math imports to suppress error if they are not otherwise used.
var _ = proto.Marshal
var _ = &json.SyntaxError{}
var _ = math.Inf

type EchoRequest struct {
	Payload          *string `protobuf:"bytes,1,req,name=payload" json:"payload,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (m *EchoRequest) Reset()         { *m = EchoRequest{} }
func (m *EchoRequest) String() string { return proto.CompactTextString(m) }
func (*EchoRequest) ProtoMessage()    {}

func (m *EchoRequest) GetPayload() string {
	if m != nil && m.Payload != nil {
		return *m.Payload
	}
	return ""
}

type EchoResponse struct {
	Payload          *string `protobuf:"bytes,2,req,name=payload" json:"payload,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (m *EchoResponse) Reset()         { *m = EchoResponse{} }
func (m *EchoResponse) String() string { return proto.CompactTextString(m) }
func (*EchoResponse) ProtoMessage()    {}

func (m *EchoResponse) GetPayload() string {
	if m != nil && m.Payload != nil {
		return *m.Payload
	}
	return ""
}

func init() {
}

// Services

type EchoService interface {
	Echo(req *EchoRequest, resp *EchoResponse) error
}

func RegisterEchoService(service EchoService) {
	rpc.RegisterName("echo.EchoService", service)
}

func NewEchoServiceClient(conn io.ReadWriteCloser) *EchoServiceClient {
	codec := muduorpc.NewClientCodec(conn)
	client := rpc.NewClientWithCodec(codec)
	return &EchoServiceClient{client}
}

type EchoServiceClient struct {
	client *rpc.Client
}

func (c *EchoServiceClient) Close() error {
	return c.client.Close()
}

func (c *EchoServiceClient) Echo(req *EchoRequest, resp *EchoResponse) error {
	return c.client.Call("echo.EchoService.Echo", req, resp)
}
