kolide

package
v1.14.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

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 Check

type Check struct {
	ID          string     `json:"id"`
	Tags        []CheckTag `json:"check_tags"`
	IssueTitle  string     `json:"issue_title"`
	Description string     `json:"description"`
}

type CheckTag added in v1.11.0

type CheckTag struct {
	Name string `json:"name"`
}

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

type ClientInterceptor struct {
	RequireTLS bool
	Token      string
}

func (*ClientInterceptor) GetRequestMetadata

func (c *ClientInterceptor) GetRequestMetadata(_ context.Context, _ ...string) (map[string]string, error)

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 Device

type Device struct {
	ID                  string     `json:"id"`
	Name                string     `json:"name"`
	Platform            string     `json:"device_type"`
	Serial              string     `json:"serial"`
	LastAuthenticatedAt *time.Time `json:"last_authenticated_at"`

	OwnerRef Reference `json:"registered_owner_info"`
	Owner    Person
}

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) GetDevice added in v1.14.0

func (f *FakeClient) GetDevice(ctx context.Context, deviceID string) (*Device, error)

GetDevice implements Client.

func (*FakeClient) GetDeviceIssues

func (f *FakeClient) GetDeviceIssues(ctx context.Context, deviceID string) ([]*Issue, error)

GetDeviceIssues implements Client.

func (*FakeClient) GetDevices

func (f *FakeClient) GetDevices(ctx context.Context) ([]*Device, error)

GetDevices implements Client.

func (*FakeClient) GetIssues

func (f *FakeClient) GetIssues(ctx context.Context) ([]*Issue, error)

GetIssues implements Client.

func (*FakeClient) GetPeople added in v1.14.0

func (f *FakeClient) GetPeople(ctx context.Context) (map[string]*Person, error)

GetPeople 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 Pagination struct {
	Next          string `json:"next"`
	NextCursor    string `json:"next_cursor"`
	CurrentCursor string `json:"current_cursor"`
	Count         int    `json:"count"`
}

type Person added in v1.11.0

type Person struct {
	ID    string `json:"id"`
	Email string `json:"email"`
}

type Reference added in v1.11.0

type Reference struct {
	Identifier string `json:"identifier"`
}

type Transport

type Transport struct {
	Token             string
	Transport         http.RoundTripper
	DefaultRetryAfter time.Duration
	MaxHTTPRetries    int
}

func NewTransport

func NewTransport(token string) *Transport

func (*Transport) RoundTrip

func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL