Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) Credentials() Credentials
- func (c *Client) FetchConfig(ctx context.Context) (DeviceConfig, error)
- func (c *Client) FetchServiceAccess(ctx context.Context) (ServiceAccess, error)
- func (c *Client) Heartbeat(ctx context.Context) error
- func (c *Client) Introspect(ctx context.Context, token string) (Introspection, error)
- func (c *Client) PollPairing(ctx context.Context, request PairingRequest) (Credentials, error)
- func (c *Client) RedeemKey(ctx context.Context, key string) (Credentials, error)
- func (c *Client) ReportInstance(ctx context.Context, report InstanceReport) (ReportResult, error)
- func (c *Client) SetCredentials(creds Credentials) error
- func (c *Client) StartPairing(ctx context.Context) (PairingRequest, error)
- type ClientOptions
- type ConnectionState
- type CredentialStore
- type Credentials
- type Device
- type DeviceConfig
- type DeviceKind
- type Endpoint
- type FileStore
- type HTTPError
- type Instance
- type InstanceReport
- type Introspection
- type MCPConfig
- type MCPEndpoint
- type Manager
- func (m *Manager) CompletePairing(ctx context.Context, request PairingRequest) error
- func (m *Manager) Connect(ctx context.Context, pairingKey string) error
- func (m *Manager) Disconnect() error
- func (m *Manager) SetSyncInterval(interval time.Duration)
- func (m *Manager) Start(ctx context.Context) error
- func (m *Manager) StartPairing(ctx context.Context) (PairingRequest, error)
- func (m *Manager) Status() Status
- func (m *Manager) Sync(ctx context.Context) error
- type ManagerOptions
- type PairingRequest
- type ReportResult
- type ServiceAccess
- type Status
- type SyncFunc
- type User
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(opts ClientOptions) (*Client, error)
func (*Client) Credentials ¶
func (c *Client) Credentials() Credentials
func (*Client) FetchConfig ¶
func (c *Client) FetchConfig(ctx context.Context) (DeviceConfig, error)
func (*Client) FetchServiceAccess ¶
func (c *Client) FetchServiceAccess(ctx context.Context) (ServiceAccess, error)
func (*Client) Introspect ¶
func (*Client) PollPairing ¶ added in v0.1.3
func (c *Client) PollPairing(ctx context.Context, request PairingRequest) (Credentials, error)
func (*Client) ReportInstance ¶
func (c *Client) ReportInstance(ctx context.Context, report InstanceReport) (ReportResult, error)
func (*Client) SetCredentials ¶
func (c *Client) SetCredentials(creds Credentials) error
func (*Client) StartPairing ¶ added in v0.1.3
func (c *Client) StartPairing(ctx context.Context) (PairingRequest, error)
StartPairing starts a browser-approved device authorization. Callers should open VerificationURL for the user, retain the full request server-side, and pass it to Manager.CompletePairing while it remains valid.
type ClientOptions ¶
type ConnectionState ¶
type ConnectionState string
const ( StateDisconnected ConnectionState = "disconnected" StateConnecting ConnectionState = "connecting" StateConnected ConnectionState = "connected" StateDegraded ConnectionState = "degraded" )
type CredentialStore ¶
type CredentialStore interface {
Load() (Credentials, error)
Save(Credentials) error
Delete() error
}
type Credentials ¶
type Device ¶
type Device struct {
ID string `json:"id"`
Name string `json:"name"`
Kind DeviceKind `json:"kind"`
ClientType string `json:"clientType"`
}
type DeviceConfig ¶
type DeviceKind ¶
type DeviceKind string
const ( DeviceKindClient DeviceKind = "client" DeviceKindService DeviceKind = "service" )
type FileStore ¶
type FileStore struct{ Path string }
func (FileStore) Load ¶
func (s FileStore) Load() (Credentials, error)
func (FileStore) Save ¶
func (s FileStore) Save(creds Credentials) error
type InstanceReport ¶
type Introspection ¶
type MCPConfig ¶
type MCPConfig struct {
Dante *MCPEndpoint `json:"dante,omitempty"`
}
type MCPEndpoint ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(opts ManagerOptions) (*Manager, error)
func (*Manager) CompletePairing ¶ added in v0.1.3
func (m *Manager) CompletePairing(ctx context.Context, request PairingRequest) error
CompletePairing waits for browser approval, persists the resulting device credential, and starts the normal synchronization lifecycle.
func (*Manager) Disconnect ¶
func (*Manager) SetSyncInterval ¶ added in v0.1.1
func (*Manager) StartPairing ¶ added in v0.1.3
func (m *Manager) StartPairing(ctx context.Context) (PairingRequest, error)
type ManagerOptions ¶
type PairingRequest ¶ added in v0.1.3
type PairingRequest struct {
DeviceCode string
UserCode string `json:"userCode"`
VerificationURL string `json:"verificationUrl"`
ExpiresAt time.Time `json:"expiresAt"`
PollInterval time.Duration `json:"-"`
}
PairingRequest describes a browser-approved device authorization that is waiting for the user at VerificationURL. DeviceCode is an opaque polling secret and must never be rendered or sent to the browser.
type ReportResult ¶
type ServiceAccess ¶
Click to show internal directories.
Click to hide internal directories.