registry

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package registry manages the user-level project path registry defined in 方案 §14.4: it stores only project id, path and last_seen_at — never project state. The file lives at <config dir>/devsys/registry.yaml and is written through the storage primitives (stable serialization + atomic replacement).

Index

Constants

View Source
const EnvDir = "DEVSYS_CONFIG_DIR"

EnvDir overrides the config directory; used by tests and portable installs.

Variables

This section is empty.

Functions

func Dir

func Dir() (string, error)

Dir returns the user-level config directory holding devsys user files.

func Path

func Path() (string, error)

Path returns the registry file path.

Types

type Entry

type Entry struct {
	ID         string
	Path       string
	LastSeenAt time.Time
}

Entry is one registered project.

type Registry

type Registry struct {
	Projects []Entry
}

Registry is the parsed registry file.

func Load

func Load(path string) (*Registry, error)

Load reads the registry; a missing file yields an empty registry.

func (*Registry) Save

func (r *Registry) Save(path string) error

Save writes the registry deterministically (entries sorted by path, atomic replacement so readers never see a torn file).

func (*Registry) Upsert

func (r *Registry) Upsert(e Entry) bool

Upsert inserts e or replaces the entry with the same path (case-insensitive on Windows). It reports whether an existing entry was replaced.

Jump to

Keyboard shortcuts

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