ServerVersion retrieves and parses the server's version (git version).
()
| 405 | |
| 406 | // ServerVersion retrieves and parses the server's version (git version). |
| 407 | func (d *DiscoveryClient) ServerVersion() (*version.Info, error) { |
| 408 | body, err := d.restClient.Get().AbsPath("/version").Do().Raw() |
| 409 | if err != nil { |
| 410 | return nil, err |
| 411 | } |
| 412 | var info version.Info |
| 413 | err = json.Unmarshal(body, &info) |
| 414 | if err != nil { |
| 415 | return nil, fmt.Errorf("unable to parse the server version: %v", err) |
| 416 | } |
| 417 | return &info, nil |
| 418 | } |
| 419 | |
| 420 | // OpenAPISchema fetches the open api schema using a rest client and parses the proto. |
| 421 | func (d *DiscoveryClient) OpenAPISchema() (*openapi_v2.Document, error) { |