mirror of
https://github.com/cirruslabs/orchard.git
synced 2026-09-30 03:51:43 +02:00
* Controller API: introduce controller's information endpoint * Prevent generation of empty events after channel closure * Allow events to be buffered in the events channel * Controller API: introduce controller's information endpoint[1] * IntegrationGuide.md: a couple of Python and Golang examples * Rephrase a sentence Co-authored-by: Fedor Korotkov <fedor.korotkov@gmail.com> --------- Co-authored-by: Fedor Korotkov <fedor.korotkov@gmail.com>
24 lines
462 B
Go
24 lines
462 B
Go
package client
|
|
|
|
import (
|
|
"context"
|
|
v1 "github.com/cirruslabs/orchard/pkg/resource/v1"
|
|
"net/http"
|
|
)
|
|
|
|
type ControllerService struct {
|
|
client *Client
|
|
}
|
|
|
|
func (service *ControllerService) Info(ctx context.Context) (v1.ControllerInfo, error) {
|
|
var controllerInfo v1.ControllerInfo
|
|
|
|
err := service.client.request(ctx, http.MethodGet, "controller/info", nil, &controllerInfo,
|
|
nil)
|
|
if err != nil {
|
|
return controllerInfo, err
|
|
}
|
|
|
|
return controllerInfo, nil
|
|
}
|