1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-04-04 20:44:27 +02:00
Asim Aslam 62801c3d68 update
2021-10-13 13:31:23 +01:00

28 lines
419 B
Go

package main
import (
"context"
proto "github.com/asim/go-micro/examples/v4/function/proto"
"go-micro.dev/v4"
)
type Greeter struct{}
func (g *Greeter) Hello(ctx context.Context, req *proto.HelloRequest, rsp *proto.HelloResponse) error {
rsp.Greeting = "Hello " + req.Name
return nil
}
func main() {
fnc := micro.NewFunction(
micro.Name("greeter"),
)
fnc.Init()
fnc.Handle(new(Greeter))
fnc.Run()
}