Help us shape the future of Go! Take the 2026 Go Developer Survey

devicesapi

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OAuthScope     = "devices:core:read"
	RequestTimeout = 15 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(config Config) *Client

func (*Client) List

func (c *Client) List(ctx context.Context) ([]Device, error)

type Config

type Config struct {
	Tailnet      string
	ClientID     string
	ClientSecret string
	BaseURL      *url.URL
	Transport    http.RoundTripper
}

type Device

type Device struct {
	Addresses          []string
	Name               string
	NodeID             string
	Tags               []string
	Hostname           string
	ConnectedToControl bool
	LastSeen           *time.Time
	NodeKey            string
	OS                 string
}

type ErrorKind

type ErrorKind string
const (
	ErrorCanceled        ErrorKind = "canceled"
	ErrorTimeout         ErrorKind = "timeout"
	ErrorUnauthorized    ErrorKind = "unauthorized"
	ErrorForbidden       ErrorKind = "forbidden"
	ErrorRateLimited     ErrorKind = "rate-limited"
	ErrorUnavailable     ErrorKind = "unavailable"
	ErrorInvalidResponse ErrorKind = "invalid-response"
)

type Lister

type Lister interface {
	List(context.Context) ([]Device, error)
}

type RequestError

type RequestError struct {
	StatusCode int
	Kind       ErrorKind
	// contains filtered or unexported fields
}

func (*RequestError) Error

func (e *RequestError) Error() string

func (*RequestError) Unwrap

func (e *RequestError) Unwrap() error

Jump to

Keyboard shortcuts

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