Versions in this module Expand all Collapse all v0 v0.1.2 Oct 8, 2026 Changes in this version + const ReasonAdminNotViaAPI v0.1.1 Oct 8, 2026 Changes in this version + const DefaultIdleTimeout + const DefaultResponseTimeout type Option + func WithIdleTimeout(d time.Duration) Option + func WithResponseTimeout(d time.Duration) Option type RetryPolicy + MaxRetryWait time.Duration v0.1.0 Oct 8, 2026 Changes in this version + const DefaultBaseURL + const EventDeskOffline + const EventDeskOnline + const EventDeskWoke + const EventJobFinished + const EventSupportSessionEnded + const EventSupportSessionJoined + const FileLimit + const LocalAPIUnavailable + const ReasonAdminDenied + const ReasonAdminNotEnabled + const ReasonAdminScopeMissing + const ReasonAdminUnavailable + const ReasonAgentCannotAdmin + const ReasonBlockedByOSPolicy + const ReasonDeskBusy + const ReasonDeskOpsDisabled + const ReasonDeskOptedOut + const ReasonDeskTokenRequired + const ReasonDeskTooOld + const ReasonE2EDecryptFailed + const ReasonE2EKeyMismatch + const ReasonE2EMalformed + const ReasonE2EOpMismatch + const ReasonE2EReplayed + const ReasonE2ERequired + const ReasonE2EStale + const ReasonE2EUnavailable + const ReasonE2EUnsealedAnswer + const ReasonE2EUnsupported + const ReasonFingerprintMismatch + const ReasonIdempotencyInFlight + const ReasonIdempotencyReused + const ReasonIncomplete + const ReasonIsFolder + const ReasonLocalAPIUnavailable + const ReasonMissingScope + const ReasonNetwork + const ReasonNoSuchRoute + const ReasonNoWakePath + const ReasonRateLimited + const ReasonTooLarge + const ReasonUnauthenticated + const ReasonUnknownDesk + const ScopeAdmin + const ScopeCp + const ScopeExec + const ScopeForward + const ScopeJobs + const ScopeScreen + const ScopeShell + const SupportCobrowse + const SupportView + const Version + const WaitForever + const WaitMax + var DefaultRetry = RetryPolicy + var DefaultScopes = []string + var ErrCommand = errors.New("gaiadesk: command failed") + var ErrConnectionLost = errors.New("gaiadesk: connection lost") + var ErrE2E = errors.New("gaiadesk: end-to-end encryption") + var ErrFailed = errors.New("gaiadesk: failed") + var ErrFingerprintMismatch = errors.New("gaiadesk: fingerprint mismatch") + var ErrInterrupted = errors.New("gaiadesk: interrupted") + var ErrProtocol = errors.New("gaiadesk: protocol") + var ErrRefused = errors.New("gaiadesk: refused") + var ErrUnreachable = errors.New("gaiadesk: unreachable") + var ErrUsage = errors.New("gaiadesk: usage") + var ErrWebhookSignature = errors.New("gaiadesk: webhook signature does not verify") + var ErrWebhookTimestamp = errors.New("gaiadesk: webhook timestamp is more than five minutes off") + var NoRetry = RetryPolicy + func LocalAPIDir(getenv func(string) string, home, goos string) string + func LocalPipeName(getenv func(string) string, username string) string + func LocalSocketPath(getenv func(string) string, home, goos string) string + func LocalTokenPath(getenv func(string) string, home, goos string) string + func NormalizeFingerprint(fp string) (string, error) + func ParseDuration(s string) (time.Duration, error) + func PipeUser(name string) string + func SignWebhook(secret string, body []byte, t time.Time) string + func VerifyWebhook(secret, signature string, body []byte, now time.Time) error + type AuditEvent struct + Action string + Actor struct{ ... } + ID string + Metadata json.RawMessage + OccurredAtMS int64 + Stream string + Target ... + type AuditFilter struct + Action string + Actor string + Desk string + Limit int + Since time.Time + Token string + Until time.Time + type CallOption func(*callConfig) + func CaptureResponse(info *ResponseInfo) CallOption + func UseDeskToken(token string) CallOption + func WakeFor(d time.Duration) CallOption + func WithIdempotencyKey(key string) CallOption + func WithoutRetry() CallOption + type Chunk struct + Data []byte + Stream string + func (c Chunk) Text() string + type Class string + const ClassConnectionLost + const ClassFailed + const ClassProtocol + const ClassRefused + const ClassUnreachable + const ClassUsage + type CliError struct + Desk string + Kind string + Message string + Reason string + type Client struct + func New(apiKey string, opts ...Option) (*Client, error) + func NewLAN(baseURL, fingerprint string, opts ...Option) (*Client, error) + func NewLocal(opts ...Option) (*Client, error) + func (c *Client) Audit(ctx context.Context, f *AuditFilter, opts ...CallOption) ([]AuditEvent, error) + func (c *Client) AuditAll(ctx context.Context, f *AuditFilter, opts ...CallOption) iter.Seq2[AuditEvent, error] + func (c *Client) BaseURL() string + func (c *Client) CreateSupportSession(ctx context.Context, s SupportSessionRequest, opts ...CallOption) (*SupportSessionCreated, error) + func (c *Client) CreateToken(ctx context.Context, t TokenRequest, opts ...CallOption) (*MintResult, error) + func (c *Client) CreateWebhook(ctx context.Context, w WebhookRequest, opts ...CallOption) (*WebhookCreated, error) + func (c *Client) DeleteWebhook(ctx context.Context, id string, opts ...CallOption) error + func (c *Client) Desk(ctx context.Context, desk string, opts ...CallOption) (*DeskDetail, error) + func (c *Client) Desks(ctx context.Context, opts ...CallOption) (*DeskList, error) + func (c *Client) Download(ctx context.Context, desk, remote string, w io.Writer, opts ...CallOption) (int64, error) + func (c *Client) DownloadBytes(ctx context.Context, desk, remote string, opts ...CallOption) ([]byte, error) + func (c *Client) DownloadFile(ctx context.Context, desk, remote, local string, opts ...CallOption) (*CopyResult, error) + func (c *Client) Exec(ctx context.Context, desk string, req ExecRequest, opts ...CallOption) (*ExecResult, error) + func (c *Client) ExecStream(ctx context.Context, desk string, req ExecRequest, opts ...CallOption) (*Stream, error) + func (c *Client) FollowJobLogs(ctx context.Context, desk, name string, o *LogsOptions, opts ...CallOption) (*Stream, error) + func (c *Client) JobLogs(ctx context.Context, desk, name string, o *LogsOptions, opts ...CallOption) (*JobLogs, error) + func (c *Client) Jobs(ctx context.Context, desk string, opts ...CallOption) ([]Job, error) + func (c *Client) KillJob(ctx context.Context, desk, name string, opts ...CallOption) (*Job, error) + func (c *Client) OpenDownload(ctx context.Context, desk, remote string, opts ...CallOption) (io.ReadCloser, error) + func (c *Client) Reach(ctx context.Context, desk string, o *ReachOptions, opts ...CallOption) (*ReachLog, error) + func (c *Client) RevokeToken(ctx context.Context, desk, token string, opts ...CallOption) (*Revoked, error) + func (c *Client) StartJob(ctx context.Context, desk string, job JobRequest, opts ...CallOption) (*Job, error) + func (c *Client) Stats(ctx context.Context, desk string, opts ...CallOption) (*StatsReport, error) + func (c *Client) SupportSession(ctx context.Context, id string, opts ...CallOption) (*SupportSession, error) + func (c *Client) SupportSessions(ctx context.Context, f *SupportSessionFilter, opts ...CallOption) ([]SupportSession, error) + func (c *Client) Tokens(ctx context.Context, desk string, opts ...CallOption) ([]TokenInfo, error) + func (c *Client) Transport() Transport + func (c *Client) Upload(ctx context.Context, desk, remote string, r io.Reader, opts ...CallOption) (*CopyResult, error) + func (c *Client) UploadFile(ctx context.Context, local, desk, remote string, opts ...CallOption) (*CopyResult, error) + func (c *Client) WaitJob(ctx context.Context, desk, name string, timeout time.Duration, ...) (*JobWaitResult, error) + func (c *Client) Wake(ctx context.Context, desk string, wait time.Duration, opts ...CallOption) (*WakeResult, error) + func (c *Client) Webhooks(ctx context.Context, opts ...CallOption) ([]Webhook, error) + type CommandError struct + Err *Error + Result *ExecResult + func (e *CommandError) Error() string + func (e *CommandError) Is(target error) bool + func (e *CommandError) Unwrap() error + type CopyFailure struct + Message string + Path string + type CopyResult struct + Bytes uint64 + Desk string + Destination string + Direction string + Dirs uint32 + Failed []CopyFailure + Files uint32 + ResumedBytes uint64 + Seconds float64 + type Desk struct + Anytime *bool + AppVersion string + DeskID string + E2EPub string + E2ERequired bool + Features []string + LastFailure *ReachFailure + LastOK *ReachSuccess + LastSeen *int64 + Name string + OS string + OfflineDetail string + OfflineReason string + OfflineReasonText string + OfflineSince *int64 + Online bool + Owner string + Reachable *bool + SignalIdleSecs *uint64 + Sources []string + type DeskDetail struct + Wake *WakeHints + type DeskEventData struct + Desk struct{ ... } + type DeskList struct + Devices []Desk + Identity *Identity + Notes []string + Sources []string + type DiskStat struct + FreeMB uint64 + Mount string + TotalMB uint64 + type E2EMode string + const E2EAuto + const E2EOff + const E2ERequire + type Error struct + Body json.RawMessage + Class Class + Desk string + Err error + ExitCode int + Kind ErrorKind + Message string + Op string + Reason string + RequestID string + RetryAfter time.Duration + Status int + func AsError(err error) *Error + func (e *Error) Error() string + func (e *Error) Is(target error) bool + func (e *Error) Temporary() bool + func (e *Error) Unwrap() error + type ErrorKind string + const KindConnectionLost + const KindFailed + const KindInterrupted + const KindLocal + const KindNetwork + const KindNotOnline + const KindNotSignedIn + const KindOffline + const KindProtocol + const KindRefused + const KindTimeout + const KindUnknownDesk + const KindUnreachable + const KindUsage + type ExecExit struct + Desk string + DurationMS uint64 + Error *CliError + Exit int + Mode string + Notes []string + RemoteCode *int + Route string + Shell string + TimedOut bool + type ExecRequest struct + Admin bool + Argv []string + Check bool + Command string + Cwd string + Env map[string]string + Shell Shell + Stdin io.Reader + Timeout time.Duration + type ExecResult struct + Desk string + DurationMS uint64 + Error *CliError + Exit int + Mode string + Notes []string + RemoteCode *int + Route string + Shell string + Stderr string + Stdout string + TimedOut bool + Truncated bool + type Exit struct + Error *CliError + ExitCode int + Job *Job + Result *ExecExit + StderrTail string + func (e *Exit) Err() error + type FingerprintMismatchError struct + Actual string + Err *Error + Expected string + func (e *FingerprintMismatchError) Error() string + func (e *FingerprintMismatchError) Is(target error) bool + func (e *FingerprintMismatchError) Unwrap() error + type Identity struct + Account string + Source string + type Job struct + By string + Command string + EndedAtMS *uint64 + Enforcement []string + ExitCode *int + Limits *JobLimits + LogBytes uint64 + Name string + PID *uint32 + Reason string + StartedAtMS uint64 + State string + type JobFinishedData struct + Desk struct{ ... } + Job Job + type JobLimits struct + CPUPercent *uint32 + KeepAwake *bool + MemMB *uint64 + Priority string + type JobLogs struct + Job *Job + Output string + type JobRequest struct + Argv []string + CPUPercent int + Command string + Cwd string + Env map[string]string + KeepAwake *bool + MemMB uint64 + Name string + Priority string + Shell Shell + type JobWaitResult struct + Job Job + TimedOut bool + type LogsOptions struct + Tail int + type MintResult struct + Tokens []MintedToken + type MintedToken struct + Desk string + Secret string + Token TokenInfo + type Option func(*config) + func WithAdminToken(t string) Option + func WithBaseURL(u string) Option + func WithDeskToken(t string) Option + func WithE2E(mode E2EMode) Option + func WithE2EKeys(keys map[string]string) Option + func WithEnv(env map[string]string) Option + func WithHTTPClient(h *http.Client) Option + func WithRetry(p RetryPolicy) Option + func WithSocketPath(p string) Option + func WithUserAgent(ua string) Option + func WithWarningHandler(f func(message string)) Option + type ReachEvent struct + At int64 + Detail string + Online bool + Reason string + ReasonText string + Version string + type ReachFailure struct + At int64 + Kind string + Message string + type ReachLog struct + DeskID string + Events []ReachEvent + Since int64 + type ReachOptions struct + Limit int + Since time.Time + type ReachSuccess struct + At int64 + ConnectMS *uint64 + RTTMS *uint64 + Route string + type ResponseInfo struct + Held bool + IdempotentReplayed bool + RateLimitLimit int + RateLimitRemaining int + RateLimitReset int + RequestID string + Sealed bool + Status int + type RetryPolicy struct + BaseDelay time.Duration + MaxAttempts int + MaxDelay time.Duration + type Revoked struct + Revoked string + StoppedSessions uint32 + type Shell string + const ShellBash + const ShellCmd + const ShellDefault + const ShellNone + const ShellPowerShell + const ShellPwsh + const ShellSh + const ShellZsh + type StatsReport struct + CPUPercent float64 + CPUs uint32 + Desk string + Disks []DiskStat + Hostname string + JobsRunning uint32 + Load []float64 + MemFreeMB uint64 + MemTotalMB uint64 + OS string + OSVersion string + UptimeSecs uint64 + type Stream struct + func (s *Stream) Chunks() iter.Seq[Chunk] + func (s *Stream) Close() error + func (s *Stream) Copy(stdout, stderr io.Writer) (*Exit, error) + func (s *Stream) Exit() *Exit + func (s *Stream) Recv() (Chunk, error) + func (s *Stream) Wait() *Exit + type SupportSession struct + CreatedAt int64 + Customer map[string]any + CustomerPresent bool + CustomerVerified bool + DeskID string + EndReason string + EndedAt *int64 + ExpiresAt int64 + ID string + JoinCode string + JoinURL string + JoinedAt *int64 + JoinedBy string + Mode string + Origin string + Owner string + State string + type SupportSessionCreated struct + EmbedToken string + type SupportSessionEventData struct + SupportSession SupportSession + type SupportSessionFilter struct + All bool + Limit int + type SupportSessionRequest struct + Customer map[string]any + ExpiresIn time.Duration + Mode string + Origin string + type TokenInfo struct + Cwd string + ExpiresAtMS uint64 + ID string + IssuedAtMS uint64 + Label string + LastUsedMS *uint64 + LowPriv bool + Revoked bool + Scopes []string + type TokenRequest struct + Cwd string + Desks []string + Expires time.Duration + LowPriv bool + Name string + Scopes []string + type Transport string + const TransportAPI + const TransportLAN + const TransportLocal + type WakeHints struct + DoorbellSockets int + LANWake bool + type WakeResult struct + AlreadyOnline bool + DeskID string + Online bool + Rang struct{ ... } + WaitedMS int64 + Woke bool + type Webhook struct + CreatedAt int64 + Description string + Events []string + ID string + URL string + type WebhookCreated struct + Secret string + type WebhookEvent struct + Created int64 + Data json.RawMessage + ID string + Type string + func ParseWebhook(secret, signature string, body []byte) (*WebhookEvent, error) + func (e *WebhookEvent) DecodeData(v any) error + type WebhookRequest struct + Description string + Events []string + URL string