micro/template/handler/example.go

20 lines
416 B
Go
Raw Normal View History

2015-01-14 02:31:27 +03:00
package handler
import (
"code.google.com/p/go.net/context"
2015-01-31 18:49:21 +03:00
log "github.com/golang/glog"
2015-05-05 21:05:06 +03:00
"github.com/myodc/go-micro/server"
example "github.com/myodc/go-micro/template/proto/example"
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
2015-05-09 02:42:07 +03:00
rsp.Msg = server.Id + ": Hello " + req.Name
2015-01-14 02:31:27 +03:00
return nil
}