desktop

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: AGPL-3.0 Imports: 34 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package desktop owns application-lifetime sharing and its authenticated local control endpoint.

Index

Constants

View Source
const ProtocolVersion = 1

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountInput

type AccountInput struct {
	Action     string `json:"action"`
	Username   string `json:"username,omitempty"`
	Password   string `json:"password,omitempty"`
	Email      string `json:"email,omitempty"`
	Code       string `json:"code,omitempty"`
	Credential string `json:"credential,omitempty"`
}

type AccountView

type AccountView struct {
	ResetLocal string           `json:"reset_local"`
	Account    account.Snapshot `json:"status"`
	Busy       bool             `json:"busy"`
	Error      *Failure         `json:"error,omitempty"`
}

type Application

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

Application owns intents independently of connections, navigation and startup. Only committed state is observed; slow admission and setup never hold mu.

type Completion

type Completion struct {
	Outcome      Outcome    `json:"outcome"`
	StopReason   StopReason `json:"stop_reason"`
	Error        string     `json:"error,omitempty"`
	CleanupError string     `json:"cleanup_error,omitempty"`
}

type CreationBlock

type CreationBlock struct {
	Reason    CreationBlockingReason `json:"reason"`
	Recovery  RecoveryAction         `json:"recovery"`
	RetryAtMS int64                  `json:"retry_at_ms,omitempty"`
}

type CreationBlockingReason

type CreationBlockingReason string

type Endpoint

type Endpoint struct {
	SessionID    string `json:"session_id"`
	Address      string `json:"address"`
	Token        string `json:"token"`
	LogDirectory string `json:"log_directory"`
}

type Failure

type Failure struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

type Host

type Host struct {
	Endpoint Endpoint
	// contains filtered or unexported fields
}

Host owns exactly one engine. Endpoint readiness only proves that control is listening; create/query report configuration and share startup separately.

func Start

func Start() (*Host, error)

func (*Host) Close

func (h *Host) Close() error

Close returns only after the control workers, engine, and log writer join.

type Message

type Message struct {
	Version     int          `json:"version"`
	ID          string       `json:"id,omitempty"`
	Snapshot    *Snapshot    `json:"snapshot,omitempty"`
	Error       *Failure     `json:"error,omitempty"`
	Observation *Observation `json:"observation,omitempty"`
}

type Observation

type Observation struct {
	OperationID string       `json:"operation_id"`
	TaskID      string       `json:"task_id"`
	Event       wire.Encoded `json:"event"`
}

type Outcome

type Outcome string
const (
	OutcomeStopped   Outcome = "stopped"
	OutcomeCancelled Outcome = "cancelled"
	OutcomeFailed    Outcome = "failed"
)

type RecoveryAction

type RecoveryAction string
const (
	RetryCreation     RecoveryAction = "retry"
	ConfigureCreation RecoveryAction = "configure"
	RepairSettings    RecoveryAction = "repair_settings"
	RepairTrustState  RecoveryAction = "repair_trust_state"
	ReplaceBuild      RecoveryAction = "replace_build"
)

type Request

type Request struct {
	ID                string        `json:"id"`
	Command           string        `json:"command"`
	SourceOperationID string        `json:"source_operation_id,omitempty"`
	OperationID       string        `json:"operation_id,omitempty"`
	TaskID            string        `json:"task_id,omitempty"`
	Relays            []string      `json:"relays,omitempty"`
	Paths             []string      `json:"paths,omitempty"`
	Setup             *SetupInput   `json:"setup,omitempty"`
	SetupID           string        `json:"setup_id,omitempty"`
	Account           *AccountInput `json:"account,omitempty"`
}

type SelectedRoot

type SelectedRoot struct {
	Name     string  `json:"name"`
	Kind     string  `json:"kind"`
	FileSize *uint64 `json:"file_size,omitempty"`
}

type Selection

type Selection struct {
	Count uint64        `json:"count"`
	Root  *SelectedRoot `json:"root,omitempty"`
}

type SetupInput

type SetupInput struct {
	ID         string                      `json:"id"`
	RelayURL   string                      `json:"relay_url"`
	FrontURL   string                      `json:"front_url"`
	AccessKey  string                      `json:"access_key,omitempty"`
	Preference *relayconfig.PreferenceEdit `json:"preference,omitempty"`
}

type SetupResult

type SetupResult struct {
	FrontendSaved bool
	RelayURL      string
	RelaySaved    bool
}

type SetupView

type SetupView struct {
	State           string                    `json:"state"`
	ID              string                    `json:"id,omitempty"`
	OperationID     string                    `json:"operation_id,omitempty"`
	RelayURL        string                    `json:"relay_url,omitempty"`
	Stage           string                    `json:"stage,omitempty"`
	VerificationURL string                    `json:"verification_url,omitempty"`
	UserCode        string                    `json:"user_code,omitempty"`
	FrontendSaved   bool                      `json:"frontend_saved"`
	RelaySaved      bool                      `json:"relay_saved"`
	Recovery        relaysetup.RecoveryAction `json:"recovery,omitempty"`
	Error           *Failure                  `json:"error,omitempty"`
}

type Share

type Share struct {
	OperationID   string                     `json:"operation_id"`
	TaskID        string                     `json:"task_id,omitempty"`
	CreatedAt     int64                      `json:"created_at_ms"`
	State         ShareState                 `json:"state"`
	Startup       string                     `json:"startup"`
	URL           string                     `json:"url,omitempty"`
	Selection     *Selection                 `json:"selection,omitempty"`
	Relay         *wire.Encoded              `json:"relay,omitempty"`
	Result        *Completion                `json:"result,omitempty"`
	Error         *Failure                   `json:"error,omitempty"`
	Blocking      *CreationBlock             `json:"blocking,omitempty"`
	Authorization *engine.ShareAuthorization `json:"authorization,omitempty"`
}

type ShareState

type ShareState string
const (
	AwaitingConfiguration ShareState = "awaiting_configuration"
	AwaitingAuthorization ShareState = "awaiting_authorization"
	AwaitingNetwork       ShareState = "awaiting_network"
	Admitting             ShareState = "admitting"
	Preparing             ShareState = "preparing"
	Sharing               ShareState = "sharing"
	Stopping              ShareState = "stopping"
	Finished              ShareState = "finished"
)

type Snapshot

type Snapshot struct {
	SessionID   string                  `json:"session_id"`
	Revision    uint64                  `json:"revision"`
	Shares      []Share                 `json:"shares"`
	Preferences relayconfig.Preferences `json:"preferences"`
	Setup       SetupView               `json:"setup"`
	Account     *AccountView            `json:"account,omitempty"`
}

type StopReason

type StopReason string
const (
	NoStopReason      StopReason = "none"
	Cancelled         StopReason = "cancelled"
	ShareStopped      StopReason = "share_stopped"
	ApplicationClosed StopReason = "application_closed"
)

Directories

Path Synopsis
Package logstore keeps bounded asynchronous host evidence off transfer goroutines.
Package logstore keeps bounded asynchronous host evidence off transfer goroutines.

Jump to

Keyboard shortcuts

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