device

package
v1.0.11 Latest Latest
Warning

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

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

Documentation

Overview

Package device provides the configured, read-only device service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExactIdentityVerifier

type ExactIdentityVerifier struct{}

ExactIdentityVerifier requires the observed hardware identity to exactly match the configured identity.

func (ExactIdentityVerifier) Verify

func (ExactIdentityVerifier) Verify(_ context.Context, expected, observed domain.DeviceID) error

type HTTPClient

type HTTPClient interface {
	Origin() string
	GetDeviceStatus(context.Context) (jetkvm.DeviceSetup, error)
	GetDevice(context.Context) (jetkvm.LocalDevice, error)
	GetCloudState(context.Context) (jetkvm.CloudState, error)
}

HTTPClient is the local HTTP observation surface used by DeviceService.

type IdentityVerifier

type IdentityVerifier interface {
	Verify(context.Context, domain.DeviceID, domain.DeviceID) error
}

IdentityVerifier is the single authority for checking a configured identity pin. Persistent TOFU or administratively provisioned pins can implement this contract without changing the observation service.

type Service

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

Service implements domain.DeviceService without opening WebRTC.

func NewService

func NewService(cfg ServiceConfig) (*Service, error)

NewService validates the complete explicit inventory before publishing it.

func (*Service) GetCapabilities

func (s *Service) GetCapabilities(ctx context.Context, id domain.DeviceID, runtime bool) (domain.CapabilitySnapshot, error)

GetCapabilities reports only capabilities established by the HTTP-only implementation and explicit device configuration.

func (*Service) GetStatus

func (s *Service) GetStatus(ctx context.Context, id domain.DeviceID, detail domain.StatusDetail) (domain.DeviceStatus, error)

GetStatus returns source-attributed HTTP observations. Non-basic detail is rejected because this implementation never opens a WebRTC session.

func (*Service) ListDevices

func (s *Service) ListDevices(context.Context) ([]domain.Device, error)

ListDevices returns only explicitly exposed devices in deterministic order.

type ServiceConfig

type ServiceConfig struct {
	Targets          []Target
	IdentityVerifier IdentityVerifier
	Now              func() time.Time
}

ServiceConfig configures the read-only device authority.

type Target

type Target struct {
	Device domain.Device
	Client HTTPClient
}

Target binds an explicitly configured device to its protocol client.

Jump to

Keyboard shortcuts

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