mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-24 10:07:04 +02:00
24 lines
604 B
Go
24 lines
604 B
Go
/*
|
|
Package client is an interface for making requests.
|
|
|
|
It provides a method to make synchronous, asynchronous and streaming requests to services.
|
|
By default json and protobuf codecs are supported.
|
|
|
|
import "github.com/micro/go-micro/client"
|
|
|
|
c := client.NewClient()
|
|
|
|
req := c.NewRequest("go.micro.srv.greeter", "Greeter.Hello", &greeter.Request{
|
|
Name: "John",
|
|
})
|
|
|
|
rsp := &greeter.Response{}
|
|
|
|
if err := c.Call(context.Background(), req, rsp); err != nil {
|
|
return err
|
|
}
|
|
|
|
fmt.Println(rsp.Msg)
|
|
*/
|
|
package client
|