Documentation
¶
Overview ¶
Package registry maintains the global list of running devrig instances so that commands like `devrig ps` and `devrig stop` can find projects without a config file argument.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InstanceEntry ¶
type InstanceEntry struct {
Slug string `json:"slug"`
ConfigPath string `json:"config_path"`
StateDir string `json:"state_dir"`
StartedAt time.Time `json:"started_at"`
}
InstanceEntry records a running (or recently stopped) devrig project.
type Registry ¶
type Registry struct {
Instances []InstanceEntry `json:"instances"`
}
Registry is the list stored at ~/.devrig/instances.json.
func Load ¶
func Load() *Registry
Load reads instances.json; returns an empty registry if the file doesn't exist.
func (*Registry) Cleanup ¶
func (r *Registry) Cleanup()
Cleanup removes entries whose state.json no longer exists.
func (*Registry) Register ¶
func (r *Registry) Register(entry InstanceEntry)
Register adds or updates an entry for the given slug.
func (*Registry) Unregister ¶
Unregister removes the entry with the given slug.
Click to show internal directories.
Click to hide internal directories.