Documentation
¶
Overview ¶
Package cache ports estimate/src/cache.ts of the Node estimate (manager): the estimate's cache under ~/.cache/dormeto/estimate/<organization or account>/, byte-compatible with Node's files. A file is {"writtenAt": <ms since the epoch>, "value": ...}, written to a temporary name then renamed (an interrupted run never leaves a broken one); one that cannot be parsed is missing. prices.json is {"<key>": {"usd": number|null, "until": <ms>}}.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FreshDiscovery ¶
FreshDiscovery: discovery is fresh a day.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is the estimate's file cache.
func (*Cache) Get ¶
Get reads path (relative to the cache directory) into out when the file is parsable, has a writtenAt and a value, and fresh accepts its time. Anything else, a missing or unparsable file included, is (false, nil).