Files
services/helloworld/handler/helloworld.go
2021-05-19 15:35:34 +01:00

18 lines
460 B
Go

package handler
import (
"context"
"github.com/micro/micro/v3/service/logger"
helloworld "github.com/micro/services/helloworld/proto"
)
type Helloworld struct{}
// Call is a single request handler called via client.Call or the generated client code
func (e *Helloworld) Call(ctx context.Context, req *helloworld.Request, rsp *helloworld.Response) error {
logger.Info("Received Helloworld.Call request")
rsp.Message = "Hello " + req.Name
return nil
}