Documentation
¶
Overview ¶
Package home resolves and manages the per-user gskill home directory (default ~/.gskill, relocatable only via GSKILL_HOME). The home holds the global content-addressed store plus its cache, staging area, locks, advisory project registry, GC pins, quarantine, and user config — all under one root so atomic renames never cross filesystems.
Index ¶
- Constants
- func Dir() (string, error)
- func FilePerm() fs.FileMode
- type Finding
- type Home
- func (h *Home) CacheDir() string
- func (h *Home) CheckPathSafety(path string) error
- func (h *Home) CheckPerms() ([]Finding, error)
- func (h *Home) ConfigFile() string
- func (h *Home) Ensure() error
- func (h *Home) LocksDir() string
- func (h *Home) PinsDir() string
- func (h *Home) ProjectsDir() string
- func (h *Home) QuarantineDir() string
- func (h *Home) Root() string
- func (h *Home) StoreDir() string
- func (h *Home) TmpDir() string
Constants ¶
const EnvHome = "GSKILL_HOME"
EnvHome is the environment variable that relocates the entire gskill home. It is the only relocation mechanism; there is no config-file equivalent.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Finding ¶
type Finding struct {
// Path is the offending file or directory.
Path string
// Problem describes what is unsafe (e.g. world-writable).
Problem string
// Remedy is the suggested fix the user can run.
Remedy string
}
Finding is one unsafe-permission observation under the home.
type Home ¶
type Home struct {
// contains filtered or unexported fields
}
Home is a resolved gskill home root with accessors for its fixed layout. Store, tmp, and locks all live under one root so staged content can be promoted with an atomic same-filesystem rename.
func (*Home) CheckPathSafety ¶
CheckPathSafety fails when path (a store object or other trusted location) is group/world-writable or owned by another user. Activation uses it to refuse unsafe objects fail-closed (FR-033).
func (*Home) CheckPerms ¶
CheckPerms audits the home tree for dangerous permissions: group- or world-writable directories/files and entries owned by another user. It reports findings rather than failing, so callers decide whether to warn or refuse (FR-033).
func (*Home) ConfigFile ¶
ConfigFile returns the user-level config file path inside the home.
func (*Home) Ensure ¶
Ensure creates the home layout with owner-only permissions. It is idempotent and never loosens permissions on existing directories.
func (*Home) ProjectsDir ¶
ProjectsDir returns the advisory project-registry directory.
func (*Home) QuarantineDir ¶
QuarantineDir returns where corrupted store objects are moved.