github.com/micro/go-micro/examples@v0.0.0-20210105173217-bf4ab679e18b/template/fnc/handler/example.go (about)

     1  package handler
     2  
     3  import (
     4  	"context"
     5  
     6  	example "github.com/micro/go-micro/examples/template/fnc/proto/example"
     7  )
     8  
     9  type Example struct{}
    10  
    11  // Call is a single request handler called via client.Call or the generated client code
    12  func (e *Example) Call(ctx context.Context, req *example.Request, rsp *example.Response) error {
    13  	rsp.Msg = "Hello " + req.Name
    14  	return nil
    15  }