Documentation
¶
Index ¶
- Variables
- func CalcProgress(goals []Goal) int
- func DetectRepo(dir string) string
- func DetectTags(dir string) []string
- func HasProject(projectRoot string) bool
- func Now() string
- func ProjectFilePath(projectRoot string) string
- func RegistryDir() string
- func RegistryPath() string
- func SyncToRegistry(projectRoot string, p *Project) error
- func WriteProject(projectRoot string, p *Project) error
- func WriteRegistry(r *Registry) error
- type FullProject
- type Goal
- type Links
- type Note
- type Project
- type ProjectStatus
- type Registry
- type RegistryEntry
- type ScanResult
- type TreeLine
- type TreeNode
Constants ¶
This section is empty.
Variables ¶
View Source
var AllStatuses = []ProjectStatus{StatusActive, StatusIdea, StatusPaused, StatusDone, StatusAbandoned}
Functions ¶
func CalcProgress ¶
func DetectRepo ¶
func DetectTags ¶
func HasProject ¶
func ProjectFilePath ¶
func RegistryDir ¶
func RegistryDir() string
func RegistryPath ¶
func RegistryPath() string
func SyncToRegistry ¶
func WriteProject ¶
func WriteRegistry ¶
Types ¶
type FullProject ¶
FullProject is a loaded project with filesystem context
func LoadAllProjects ¶
func LoadAllProjects() ([]FullProject, error)
type Project ¶
type Project struct {
ID string `json:"id"`
Name string `json:"name"`
Description *string `json:"description"`
Status ProjectStatus `json:"status"`
Progress int `json:"progress"`
Tags []string `json:"tags"`
Created string `json:"created"`
LastActivity string `json:"lastActivity"`
Goals []Goal `json:"goals"`
Notes []Note `json:"notes"`
Links Links `json:"links"`
// Extra fields preserved on round-trip
Extra map[string]any `json:"-"`
}
func CreateProject ¶
func ReadProject ¶
type ProjectStatus ¶
type ProjectStatus string
const ( StatusActive ProjectStatus = "active" StatusIdea ProjectStatus = "idea" StatusPaused ProjectStatus = "paused" StatusDone ProjectStatus = "done" StatusAbandoned ProjectStatus = "abandoned" )
type Registry ¶
type Registry struct {
Version int `json:"version"`
Projects []RegistryEntry `json:"projects"`
}
func ReadRegistry ¶
type RegistryEntry ¶
type ScanResult ¶
ScanResult is a discovered project not yet tracked by drift
func ScanDir ¶
func ScanDir(root string, maxDepth int) []ScanResult
ScanDir recursively finds projects in a directory. maxDepth limits recursion (0 = root only, -1 = unlimited). Skips directories that already have .drift/, and known non-project dirs.
type TreeLine ¶
type TreeLine struct {
Indent int
Name string
IsDir bool
Project *FullProject
Last bool // last child at this level (for tree drawing)
}
FlattenTree produces a flat list with indentation info for rendering.
func FlattenTree ¶
type TreeNode ¶
type TreeNode struct {
Name string // directory name
FullPath string // absolute path
Project *FullProject // nil if just a directory
Children []*TreeNode
}
BuildTree groups projects by their parent directory relative to a common root.
func BuildProjectTree ¶
func BuildProjectTree(projects []FullProject) *TreeNode
BuildProjectTree organizes projects into a directory tree.
Click to show internal directories.
Click to hide internal directories.