Documentation
¶
Index ¶
- Constants
- type Client
- type ClientImpl
- func (c *ClientImpl) DeviceGroupHelper(ctx context.Context, token string, deviceIds []string, ...) (result model.DeviceGroupHelperResult, code int, err error)
- func (c *ClientImpl) GetBulkSelectablesV2(ctx context.Context, token string, bulk model.BulkRequestV2, ...) (model.BulkResult, int, error)
- func (c *ClientImpl) GetSelectables(ctx context.Context, token string, criteria []models.DeviceGroupFilterCriteria, ...) ([]model.Selectable, int, error)
- type DeviceGroupHelperOptions
- type GetBulkSelectablesOptions
- type GetSelectablesOptions
- type Options
- type TestClient
- func (c *TestClient) DeviceGroupHelper(ctx context.Context, token string, deviceIds []string, ...) (model.DeviceGroupHelperResult, int, error)
- func (c *TestClient) GetBulkSelectablesV2(ctx context.Context, token string, bulk model.BulkRequestV2, ...) (model.BulkResult, int, error)
- func (c *TestClient) GetSelectables(ctx context.Context, token string, criteria []models.DeviceGroupFilterCriteria, ...) ([]model.Selectable, int, error)
- func (c *TestClient) SetBulkResponse(value model.BulkResult, code int, err error)
- func (c *TestClient) SetDeviceGroupHelperResponse(value model.DeviceGroupHelperResult, code int, err error)
- func (c *TestClient) SetResponse(value []model.Selectable, code int, err error)
Constants ¶
const InternalAdminToken = `` /* 727-byte string literal not displayed */
InternalAdminToken is expired and invalid. but because this service does not validate the received tokens, it may be used by trusted internal services which are within the same network (kubernetes cluster). requests with this token may not be routed over an ingres with token validation
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
GetSelectables(ctx context.Context, token string, criteria []models.DeviceGroupFilterCriteria, options *GetSelectablesOptions) ([]model.Selectable, int, error)
GetBulkSelectablesV2(ctx context.Context, token string, bulk model.BulkRequestV2, options *GetBulkSelectablesOptions) (model.BulkResult, int, error)
DeviceGroupHelper(ctx context.Context, token string, deviceIds []string, options *DeviceGroupHelperOptions) (model.DeviceGroupHelperResult, int, error)
}
type ClientImpl ¶
type ClientImpl struct {
// contains filtered or unexported fields
}
func (*ClientImpl) DeviceGroupHelper ¶
func (c *ClientImpl) DeviceGroupHelper(ctx context.Context, token string, deviceIds []string, options *DeviceGroupHelperOptions) (result model.DeviceGroupHelperResult, code int, err error)
func (*ClientImpl) GetBulkSelectablesV2 ¶
func (c *ClientImpl) GetBulkSelectablesV2(ctx context.Context, token string, bulk model.BulkRequestV2, options *GetBulkSelectablesOptions) (model.BulkResult, int, error)
GetBulkSelectablesV2 asks for the selectables of several criteria sets in one request. Each element of the answer carries the id its request element had, so a caller that named them after something of its own - a bpmn element, say - can match the result back to it without relying on the order.
func (*ClientImpl) GetSelectables ¶
func (c *ClientImpl) GetSelectables(ctx context.Context, token string, criteria []models.DeviceGroupFilterCriteria, options *GetSelectablesOptions) ([]model.Selectable, int, error)
type GetBulkSelectablesOptions ¶
type GetBulkSelectablesOptions struct {
// CompleteServices adds the full import type and the import path options to the answer.
// Device services are complete either way; the name is a legacy artefact of the endpoint.
CompleteServices bool
}
type GetSelectablesOptions ¶
type GetSelectablesOptions struct {
IncludeGroups bool
IncludeImports bool
IncludeDevices bool
IncludeIdModified bool
// ImportPathTrimFirstElement drops the first element of the import paths in the answer;
// only meaningful with IncludeImports
ImportPathTrimFirstElement bool
WithDeviceIds []string
WithLocalDeviceIds []string
LocalDeviceOwner string
FilterByDeviceAttributeKeys []string
}
type Options ¶ added in v2.2.0
type Options struct {
// Timeout bounds every request including reading its answer; 0 leaves the bound to the context
// of the call and to HttpClient
Timeout time.Duration
// HttpClient sends the requests; nil means http.DefaultClient. Timeout is set on a copy, the
// given client stays unchanged.
HttpClient *http.Client
}
Options configure a client from NewClient. The zero value sends with http.DefaultClient, without a timeout of its own.
type TestClient ¶
type TestClient struct {
// contains filtered or unexported fields
}
func NewTestClient ¶
func NewTestClient() *TestClient
func (*TestClient) DeviceGroupHelper ¶
func (c *TestClient) DeviceGroupHelper(ctx context.Context, token string, deviceIds []string, options *DeviceGroupHelperOptions) (model.DeviceGroupHelperResult, int, error)
func (*TestClient) GetBulkSelectablesV2 ¶
func (c *TestClient) GetBulkSelectablesV2(ctx context.Context, token string, bulk model.BulkRequestV2, options *GetBulkSelectablesOptions) (model.BulkResult, int, error)
GetBulkSelectablesV2 answers every request element with the same selectables, unless a bulk result was set explicitly. Answering per element is what a caller that keys the result by id needs, so the fallback keeps the ids of the request rather than returning an empty list.
func (*TestClient) GetSelectables ¶
func (c *TestClient) GetSelectables(ctx context.Context, token string, criteria []models.DeviceGroupFilterCriteria, options *GetSelectablesOptions) ([]model.Selectable, int, error)
func (*TestClient) SetBulkResponse ¶
func (c *TestClient) SetBulkResponse(value model.BulkResult, code int, err error)
func (*TestClient) SetDeviceGroupHelperResponse ¶
func (c *TestClient) SetDeviceGroupHelperResponse(value model.DeviceGroupHelperResult, code int, err error)
func (*TestClient) SetResponse ¶
func (c *TestClient) SetResponse(value []model.Selectable, code int, err error)