add comments

This commit is contained in:
Asim 2015-12-03 01:05:16 +00:00
parent 9e3f3bbc0e
commit 919bfed0c1
2 changed files with 20 additions and 1 deletions

View File

@ -7,7 +7,7 @@ supported.
c := client.NewClient() c := client.NewClient()
req := c.NewRequest("go.micro.srv.greeter", &greeter.Request{ req := c.NewRequest("go.micro.srv.greeter", "Greeter.Hello", &greeter.Request{
Name: "John", Name: "John",
}) })

View File

@ -6,6 +6,25 @@ register with a broker.
The server combines the all the packages in go-micro to create a whole unit The server combines the all the packages in go-micro to create a whole unit
used for building applications including discovery, client/server communication used for building applications including discovery, client/server communication
and pub/sub. and pub/sub.
import "github.com/micro/go-micro/server"
type Greeter struct {}
func (g *Greeter) Hello(ctx context.Context, req *greeter.Request, rsp *greeter.Response) error {
rsp.Msg = "Hello " + req.Name
return nil
}
s := server.NewServer()
s.Handle(
s.NewHandler(&Greeter{}),
)
s.Start()
*/ */
package server package server