chore: import upstream snapshot with attribution
govulncheck / govulncheck (push) Has been cancelled
Lint / golangci-lint (push) Has been cancelled
Run Tests / Unit Tests (push) Has been cancelled
Run Tests / Etcd Integration Tests (push) Has been cancelled
Harness (E2E) / Harnesses (mock LLM) (push) Has been cancelled
Harness (E2E) / Provider harnesses (live LLM conformance) (push) Has been cancelled
govulncheck / govulncheck (push) Has been cancelled
Lint / golangci-lint (push) Has been cancelled
Run Tests / Unit Tests (push) Has been cancelled
Run Tests / Etcd Integration Tests (push) Has been cancelled
Harness (E2E) / Harnesses (mock LLM) (push) Has been cancelled
Harness (E2E) / Provider harnesses (live LLM conformance) (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# RPC Client
|
||||
|
||||
Call a running service using the Go Micro client.
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"go-micro.dev/v6"
|
||||
)
|
||||
|
||||
type Request struct { Name string }
|
||||
|
||||
type Response struct { Message string }
|
||||
|
||||
func main() {
|
||||
svc := micro.NewService("caller")
|
||||
svc.Init()
|
||||
|
||||
req := svc.Client().NewRequest("helloworld", "Say.Hello", &Request{Name: "John"})
|
||||
var rsp Response
|
||||
|
||||
if err := svc.Client().Call(context.TODO(), req, &rsp); err != nil {
|
||||
fmt.Println("error:", err)
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(rsp.Message)
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user