daemon

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallService

func InstallService(logger *slog.Logger, cfg *config.Config, cfgPath string) error

func IsInstalled

func IsInstalled() bool

func NewProgram

func NewProgram(logger *slog.Logger, cfg *config.Config, cfgPath string) *program

func RunAsService

func RunAsService(logger *slog.Logger, cfg *config.Config, cfgPath string) error

func ServiceConfig

func ServiceConfig() *service.Config

func StartService

func StartService(logger *slog.Logger, cfg *config.Config, cfgPath string) error

func StopService

func StopService(logger *slog.Logger, cfg *config.Config, cfgPath string) error

func UninstallService

func UninstallService(logger *slog.Logger, cfg *config.Config, cfgPath string) error

Types

type Daemon

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

func New

func New(ctx context.Context, logger *slog.Logger, cfg *config.Config, cfgPath string) *Daemon

func (*Daemon) GetConfig

func (d *Daemon) GetConfig() api.ConfigSnapshot

func (*Daemon) GetSession

func (d *Daemon) GetSession(id string) (*api.SessionDetailResponse, error)

func (*Daemon) GetSessions

func (d *Daemon) GetSessions() []api.SessionInfo

func (*Daemon) KillSession

func (d *Daemon) KillSession(ctx context.Context, sessionID string) error

func (*Daemon) ResumeSession

func (d *Daemon) ResumeSession(ctx context.Context, sessionID string) error

func (*Daemon) Run

func (d *Daemon) Run() error

func (*Daemon) Shutdown

func (d *Daemon) Shutdown()

type History

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

func NewHistory

func NewHistory(logger *slog.Logger, path string) *History

func (*History) Record

func (h *History) Record(sessionID, agent, action, trigger string, cost float64)

type HistoryEntry

type HistoryEntry struct {
	Timestamp time.Time `json:"timestamp"`
	SessionID string    `json:"session_id"`
	Agent     string    `json:"agent"`
	Action    string    `json:"action"`
	Trigger   string    `json:"trigger"`
	CostUSD   float64   `json:"cost_usd"`
}

Jump to

Keyboard shortcuts

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