Documentation
¶
Index ¶
- Constants
- type Daemon
- func (d *Daemon) Cleanup()
- func (d *Daemon) Daemonize(args []string) (bool, error)
- func (d *Daemon) IsRunning() bool
- func (d *Daemon) KillAll() (int, error)
- func (d *Daemon) ListProcesses() ([]ProcessInfo, error)
- func (d *Daemon) PIDPath() string
- func (d *Daemon) ReadPID() (int, error)
- func (d *Daemon) ReadState() (*State, error)
- func (d *Daemon) RemovePID() error
- func (d *Daemon) RemoveState() error
- func (d *Daemon) Start(restEnabled bool, restHost string, restPort int, mcpEnabled bool) error
- func (d *Daemon) StatePath() string
- func (d *Daemon) Status() *Status
- func (d *Daemon) Stop() error
- func (d *Daemon) WritePID() error
- func (d *Daemon) WriteState(state *State) error
- type ProcessInfo
- type State
- type Status
Constants ¶
View Source
const ( PIDFileName = "mycelicmemory.pid" StateFileName = "mycelicmemory.state" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon manages the mycelicmemory daemon lifecycle
func (*Daemon) Cleanup ¶
func (d *Daemon) Cleanup()
Cleanup removes PID and state files (called on graceful shutdown)
func (*Daemon) Daemonize ¶
Daemonize forks the current process and runs it as a daemon Returns true if we're in the child (daemon) process, false if parent
func (*Daemon) ListProcesses ¶
func (d *Daemon) ListProcesses() ([]ProcessInfo, error)
ListProcesses returns a list of running mycelicmemory processes
func (*Daemon) RemoveState ¶
RemoveState removes the state file
func (*Daemon) WriteState ¶
WriteState writes the daemon state to disk
type ProcessInfo ¶
type ProcessInfo struct {
PID int `json:"pid"`
Type string `json:"type"`
Uptime time.Duration `json:"uptime"`
Version string `json:"version"`
}
ProcessInfo represents information about a running process
type State ¶
type State struct {
PID int `json:"pid"`
StartTime time.Time `json:"start_time"`
Version string `json:"version"`
RESTEnabled bool `json:"rest_enabled"`
RESTHost string `json:"rest_host"`
RESTPort int `json:"rest_port"`
MCPEnabled bool `json:"mcp_enabled"`
}
State represents the daemon state persisted to disk
type Status ¶
type Status struct {
Running bool `json:"running"`
PID int `json:"pid,omitempty"`
Uptime time.Duration `json:"uptime,omitempty"`
Version string `json:"version,omitempty"`
RESTEnabled bool `json:"rest_enabled,omitempty"`
RESTHost string `json:"rest_host,omitempty"`
RESTPort int `json:"rest_port,omitempty"`
MCPEnabled bool `json:"mcp_enabled,omitempty"`
}
Status represents the current daemon status
Click to show internal directories.
Click to hide internal directories.