mirror of
https://github.com/go-micro/go-micro.git
synced 2025-01-05 10:20:53 +02:00
d94936f6c9
* v3 * revert plugins * fixup some issues
25 lines
450 B
Go
25 lines
450 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"github.com/asim/go-micro/v3"
|
|
"github.com/asim/go-micro/v3/client"
|
|
)
|
|
|
|
func main() {
|
|
service := micro.NewService()
|
|
service.Init()
|
|
c := service.Client()
|
|
|
|
request := c.NewRequest("greeter", "Greeter.Hello", "john", client.WithContentType("application/json"))
|
|
var response string
|
|
|
|
if err := c.Call(context.TODO(), request, &response); err != nil {
|
|
fmt.Println(err)
|
|
return
|
|
}
|
|
fmt.Println(response)
|
|
}
|