state

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetModuleFileTree

func GetModuleFileTree(name string, module *ModuleState, dotfilesDir string, simple bool) (*tree.Node, error)

func GetStateFileTree

func GetStateFileTree(state *State, dotfilesDir string, simple bool) (*tree.Node, error)

func SaveState

func SaveState(state *State, dotfilesDir string) error

Types

type DeployStatus

type DeployStatus int
const (
	NotDeployed DeployStatus = iota
	Unsynced
	Synced
)

type Entry

type Entry struct {
	Status           DeployStatus `json:"status"`
	SourceHash       string       `json:"hash"`
	IntermediatePath string       `json:"intermediatePath"`
	SymlinkPath      string       `json:"symlinkPath"`
}

type ModuleState

type ModuleState struct {
	Status     DeployStatus      `json:"status"`
	DeployedAt time.Time         `json:"deployedAt"`
	Files      map[string]*Entry `json:"files"`
}

type State

type State struct {
	Modules map[string]*ModuleState `json:"modules"`
}

State should only be created once, via peridot init. Modifications to state should only be made after loading it from a state file, and the state file should be updated right after.

func LoadState

func LoadState(dotfilesDir string) (*State, error)

func (*State) Refresh

func (s *State) Refresh(dotfilesDir string) error

Jump to

Keyboard shortcuts

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