Documentation
¶
Index ¶
- Variables
- func DeviceEventStreamer(ctx context.Context, log logrus.FieldLogger, grpcAddress, grpcToken string, ...) error
- func New(token string, log logrus.FieldLogger, opts ...ClientOption) *client
- type Check
- type CheckTag
- type Client
- type ClientInterceptor
- type ClientOption
- type Device
- type FakeClient
- func (f *FakeClient) Build() Client
- func (f *FakeClient) GetChecks(ctx context.Context) ([]*Check, error)
- func (f *FakeClient) GetDevice(ctx context.Context, deviceID string) (*Device, error)
- func (f *FakeClient) GetDeviceIssues(ctx context.Context, deviceID string) ([]*Issue, error)
- func (f *FakeClient) GetDevices(ctx context.Context) ([]*Device, error)
- func (f *FakeClient) GetIssues(ctx context.Context) ([]*Issue, error)
- func (f *FakeClient) GetPeople(ctx context.Context) (map[string]*Person, error)
- type Issue
- type PaginatedResponse
- type Pagination
- type Person
- type Reference
- type Transport
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMaxRetriesExceeded = errors.New("max retries exceeded")
Functions ¶
func DeviceEventStreamer ¶
func DeviceEventStreamer(ctx context.Context, log logrus.FieldLogger, grpcAddress, grpcToken string, grpcSecure bool, stream chan<- *kolidepb.DeviceEvent) error
func New ¶
func New(token string, log logrus.FieldLogger, opts ...ClientOption) *client
Types ¶
type Client ¶
type Client interface {
GetIssues(ctx context.Context) ([]*Issue, error)
GetDeviceIssues(ctx context.Context, deviceID string) ([]*Issue, error)
GetChecks(ctx context.Context) ([]*Check, error)
GetDevice(ctx context.Context, deviceID string) (*Device, error)
GetDevices(ctx context.Context) ([]*Device, error)
GetPeople(ctx context.Context) (map[string]*Person, error)
}
type ClientInterceptor ¶
func (*ClientInterceptor) GetRequestMetadata ¶
func (*ClientInterceptor) RequireTransportSecurity ¶
func (c *ClientInterceptor) RequireTransportSecurity() bool
type ClientOption ¶
type ClientOption func(*client)
func WithBaseURL ¶ added in v1.11.0
func WithBaseURL(baseURL string) ClientOption
type FakeClient ¶
type FakeClient struct {
Devices []Device
}
func (*FakeClient) Build ¶
func (f *FakeClient) Build() Client
func (*FakeClient) GetChecks ¶
func (f *FakeClient) GetChecks(ctx context.Context) ([]*Check, error)
GetChecks implements Client.
func (*FakeClient) GetDeviceIssues ¶
GetDeviceIssues implements Client.
func (*FakeClient) GetDevices ¶
func (f *FakeClient) GetDevices(ctx context.Context) ([]*Device, error)
GetDevices implements Client.
type Issue ¶ added in v1.11.0
type Issue struct {
ID string `json:"id"`
Value map[string]any `json:"value"`
Title string `json:"title"`
DetectedAt *time.Time `json:"detected_at"`
ResolvedAt *time.Time `json:"resolved_at"`
LastRecheckedAt *time.Time `json:"last_rechecked_at"`
Exempted bool `json:"exempted"`
DeviceRef Reference `json:"device_information"`
CheckRef Reference `json:"check_information"`
}
type PaginatedResponse ¶
type PaginatedResponse struct {
Data []json.RawMessage `json:"data"`
Pagination Pagination `json:"pagination"`
}
type Pagination ¶
type Transport ¶
type Transport struct {
Token string
Transport http.RoundTripper
DefaultRetryAfter time.Duration
MaxHTTPRetries int
}
func NewTransport ¶
Click to show internal directories.
Click to hide internal directories.