1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-12 08:23:58 +02:00
go-micro/examples/noproto/main.go
Asim Aslam d94936f6c9
v3 (#2104)
* v3

* revert plugins

* fixup some issues
2021-01-20 13:54:31 +00:00

31 lines
462 B
Go

package main
import (
"context"
"github.com/asim/go-micro/v3"
)
type Greeter struct{}
func (g *Greeter) Hello(ctx context.Context, name *string, msg *string) error {
*msg = "Hello " + *name
return nil
}
func main() {
// create new service
service := micro.NewService(
micro.Name("greeter"),
)
// initialise command line
service.Init()
// set the handler
micro.RegisterHandler(service.Server(), new(Greeter))
// run service
service.Run()
}