Documentation
¶
Overview ¶
Package cache keeps small name/ID indexes on disk so mistctl can resolve names, fill completions and label IDs without spending API budget.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultDir ¶
func DefaultDir() string
DefaultDir returns the cache directory, honouring $MISTCTL_CACHE_DIR.
func Key ¶
Key builds a cache key from the scope parts (cloud host, org, ...). The token is never part of the key or the stored data.
func NormalizeMAC ¶
NormalizeMAC lowercases a MAC and strips separators.
Types ¶
type Entry ¶
type Entry struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
MAC string `json:"mac,omitempty"`
SiteID string `json:"site_id,omitempty"`
Type string `json:"type,omitempty"`
}
Entry is one indexed object.
type Store ¶
Store is a cache rooted in one directory.
func (*Store) Clear ¶
Clear removes the cache files mistctl wrote, and only those: scope directories named like a Key, holding index files (and leftover temporary files of interrupted writes). Anything else in the cache directory is left alone, so a cache directory set to a shared folder never loses unrelated files. Obviously unsafe roots (filesystem root, home, current directory) are refused outright.