2015-01-14 02:31:27 +03:00
|
|
|
package handler
|
|
|
|
|
|
|
|
import (
|
|
|
|
"code.google.com/p/go.net/context"
|
|
|
|
"code.google.com/p/goprotobuf/proto"
|
|
|
|
|
|
|
|
"github.com/asim/go-micro/server"
|
|
|
|
example "github.com/asim/go-micro/template/proto/example"
|
2015-01-31 18:49:21 +03:00
|
|
|
log "github.com/golang/glog"
|
2015-01-14 02:31:27 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
type Example struct{}
|
|
|
|
|
|
|
|
func (e *Example) Call(ctx context.Context, req *example.Request, rsp *example.Response) error {
|
2015-01-31 18:49:21 +03:00
|
|
|
log.Info("Received Example.Call request")
|
2015-01-14 02:31:27 +03:00
|
|
|
|
|
|
|
rsp.Msg = proto.String(server.Id + ": Hello " + req.GetName())
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|