identity

package
v0.38.4 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProjectIdentity

type ProjectIdentity struct {
	// Slug is a URL-safe identifier derived from the project name + config path hash.
	// Used in container/network/cluster names.
	Slug string
	// ConfigPath is the absolute path to devrig.toml.
	ConfigPath string
	// ProjectDir is the directory containing devrig.toml.
	ProjectDir string
	// StateDir is ~/.devrig/<slug>/ — where state.json and kubeconfig are stored.
	StateDir string
}

ProjectIdentity holds the computed identifiers for a devrig project instance.

func New

func New(projectName, configPath string) (*ProjectIdentity, error)

New computes a ProjectIdentity from the project name and config path. The slug is: <name>-<6-char-hash> to allow multiple instances with the same project name (different directories).

A project keeps the first slug it was ever assigned, recorded in a persistent index, so a future change to the slug algorithm doesn't silently re-slug the project and orphan its cluster/containers/state (as the Rust→Go rewrite did when it shortened the hash from 8 to 6 hex chars).

func (*ProjectIdentity) EnsureStateDir

func (id *ProjectIdentity) EnsureStateDir() error

EnsureStateDir creates the state directory if it does not exist.

Jump to

Keyboard shortcuts

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