Skip to content

daemon

import "github.com/ananth/codespace-zed/internal/daemon"

Package daemon implements the codespace-zed menu bar applet which hosts a system tray icon, global hotkey listener, and codespace lifecycle management.

Index

type Daemon

Daemon is the long-running background process that hosts the system tray, hotkey listener, and codespace poller.

type Daemon struct {
    Cfg        *config.Config
    ConfigPath string
    Runner     codespace.GHRunner
    // contains filtered or unexported fields
}

func New

func New(cfg *config.Config, configPath string) *Daemon

New creates a new Daemon with the given config.

func (*Daemon) Codespaces

func (d *Daemon) Codespaces() []codespace.Codespace

Codespaces returns the last-polled codespace list.

func (*Daemon) Run

func (d *Daemon) Run() error

Run starts all applet components. It blocks until Stop is called. This must be called from the main OS thread.

func (*Daemon) SetCodespaces

func (d *Daemon) SetCodespaces(cs []codespace.Codespace)

SetCodespaces updates the cached codespace list.

func (*Daemon) Stop

func (d *Daemon) Stop()

Stop signals the applet to shut down.

Generated by gomarkdoc