Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
Cache manages the loading, updating, and saving of the index.
func (*Cache) Get ¶
Get retrieves an entry if it exists and is fresh. Returns entry and true if hit. Returns nil and false if miss or stale.
func (*Cache) Load ¶
Load reads the cache from disk. If not found or invalid, returns empty index (no error).
func (*Cache) Set ¶
func (c *Cache) Set(relPath string, entry *IndexEntry)
Set updates an entry in the cache.
type Index ¶
type Index struct {
Version int `json:"version"`
Entries map[string]*IndexEntry `json:"entries"` // Key is relative path (e.g. "notes/foo.md")
// contains filtered or unexported fields
}
Index represents the persistent cache state.
type IndexEntry ¶
type IndexEntry struct {
ID string `json:"id"`
Title string `json:"title,omitempty"`
Tags []string `json:"tags,omitempty"`
LastModified time.Time `json:"lastLimit"` // Ensure typo is fixed: LastModified
}
IndexEntry represents collected metadata for a single file.
type Metadata ¶
type Metadata map[string]interface{}
Metadata aliases the flexible YAML frontmatter map.
type Note ¶
type Note struct {
ID string // Typically the filename without extension
Metadata Metadata // Parsed YAML frontmatter
Content string // The markdown body
}
Note represents a Markdown file with optional YAML frontmatter.
type Vault ¶
Vault represents a directory containing notes backed by Git.
func NewVault ¶
NewVault creates a Vault instance rooted at the given path. It ensures the path exists and initializes the Git client.
func (*Vault) List ¶
List returns a list of all notes in the vault. It scans the directory recursively for .md files and parses them.
func (*Vault) Read ¶
Read loads a note by its ID (filename without extension). It looks for {ID}.md in the vault root.