desktop

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: AGPL-3.0 Imports: 36 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"`
	AccountID  string `json:"account_id,omitempty"`
	Nickname   string `json:"nickname,omitempty"`
	Challenge  string `json:"challenge,omitempty"`
	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 AccountOperation added in v0.1.4

type AccountOperation struct {
	ID    string   `json:"id"`
	State string   `json:"state"`
	Error *Failure `json:"error,omitempty"`
}

type AccountView

type AccountView struct {
	ResetLocal          string            `json:"reset_local,omitempty"`
	NicknameChangeLocal string            `json:"nickname_change_local,omitempty"`
	Account             account.Snapshot  `json:"status"`
	Operation           *AccountOperation `json:"operation,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"`
	EngineCode         string                     `json:"engine_code,omitempty"`
	SourcePath         string                     `json:"source_path,omitempty"`
	SelectionCollision *engine.SelectionCollision `json:"selection_collision,omitempty"`
}

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"`
}

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 RelayAvailability added in v0.1.6

type RelayAvailability struct {
	Available uint32 `json:"available"`
	Total     uint32 `json:"total"`
	EverReady bool   `json:"ever_ready"`
	Terminal  uint32 `json:"terminal"`
}

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"`
	RelayURL           string        `json:"relay_url,omitempty"`
	Paths              []string      `json:"paths,omitempty"`
	Setup              *SetupInput   `json:"setup,omitempty"`
	SetupID            string        `json:"setup_id,omitempty"`
	Account            *AccountInput `json:"account,omitempty"`
	AccountViewVisible *bool         `json:"account_view_visible,omitempty"`
	SenderTrace        *bool         `json:"sender_trace,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 SenderTraceState added in v0.1.5

type SenderTraceState string
const (
	SenderTraceUnavailable SenderTraceState = "unavailable"
	SenderTraceOff         SenderTraceState = "off"
	SenderTraceOn          SenderTraceState = "on"
)

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"`
	RelayOperation relaysetup.Operation        `json:"relay_operation,omitempty"`
	Preference     *relayconfig.PreferenceEdit `json:"preference,omitempty"`
}

type SetupResult

type SetupResult struct {
	FrontendSaved bool
	RelayURL      string
	RelaySaved    bool
	RelayRemoved  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"`
	RelayOperation  relaysetup.Operation      `json:"relay_operation,omitempty"`
	Stage           string                    `json:"stage,omitempty"`
	VerificationURL string                    `json:"verification_url,omitempty"`
	ServiceLogin    *relaysetup.ServiceLogin  `json:"service_login,omitempty"`
	UserCode        string                    `json:"user_code,omitempty"`
	FrontendSaved   bool                      `json:"frontend_saved"`
	RelaySaved      bool                      `json:"relay_saved"`
	RelayRemoved    bool                      `json:"relay_removed"`
	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"`
	URL           string                     `json:"url,omitempty"`
	BackupURL     string                     `json:"backup_url,omitempty"`
	Selection     *Selection                 `json:"selection,omitempty"`
	Relay         *RelayAvailability         `json:"relay,omitempty"`
	Omissions     *SourceOmissions           `json:"omissions,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"`
	SenderTrace SenderTraceState        `json:"sender_trace"`
	Account     *AccountView            `json:"account,omitempty"`
}

type SourceOmission added in v0.1.6

type SourceOmission struct {
	Name   string `json:"name"`
	Reason string `json:"reason"`
	Detail string `json:"detail,omitempty"`
}

type SourceOmissions added in v0.1.6

type SourceOmissions struct {
	Count   uint64           `json:"count"`
	Samples []SourceOmission `json:"samples,omitempty"`
}

type StopReason

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

Jump to

Keyboard shortcuts

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