devauth

package
v0.0.0-...-4a3d6f3 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	URIInternal        = "/api/internal/v1/devauth"
	URIInternalDevices = URIInternal + "/tenants/:tenant/devices"
	URIInternalAlive   = URIInternal + "/alive"
)
View Source
const DefaultTimeout = time.Second * 10

Variables

View Source
var (
	ErrInvalidURL = errors.New("invalid URL format")
)

Functions

This section is empty.

Types

type Client

type Client interface {
	Ping(ctx context.Context) error
	GetDevices(context.Context, []string) ([]Device, error)
}

Client interface exposing a portion of the internal deviceauth API.

func NewClient

func NewClient(config Config) (Client, error)

NewClient initializes a new client from the given configuration options.

type Config

type Config struct {
	// Client provides an option to override the http.Client used for
	// performing the requests.
	Client *http.Client
	// DevauthAddress is the base URI to the deviceauth service (requires
	// a minimal of an addressable hostname, to a full blown URL).
	DevauthAddress string
}

Config provides initialization options for creating a new client.

func (Config) Validate

func (conf Config) Validate() error

type Device

type Device struct {
	ID     string       `json:"id"`
	Status model.Status `json:"status"`
}

Device definition containing subset of the deviceauth model

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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