registry

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 4 Imported by: 0

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) Save

func (r *Registry) Save() error

Save writes instances.json atomically (tmp → rename).

func (*Registry) Unregister

func (r *Registry) Unregister(slug string)

Unregister removes the entry with the given slug.

Jump to

Keyboard shortcuts

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