Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository keeps a copy of the data from the remote location on the local filesystem. It implements the tldr.Repository to provide quick access to the requested markdown.
func NewRepository ¶
func NewRepository(remote string, ttl time.Duration) (*Repository, error)
NewRepository returns a new cache repository. The data is loaded from the remote if missing or stale.
func (*Repository) AvailablePlatforms ¶
func (r *Repository) AvailablePlatforms() ([]string, error)
AvailablePlatforms returns all the availale platforms found in cache.
func (*Repository) Markdown ¶
func (r *Repository) Markdown(platform, page string) (io.ReadCloser, error)
Markdown pulls the markdown from the page in cache.
func (*Repository) Pages ¶
func (r *Repository) Pages() ([]string, error)
Pages returns all the pages for the given platform.
func (*Repository) Reload ¶
func (r *Repository) Reload() error
Reload removes the cache directory, recreates it, and saves the data from the remote to the local filesystem.
Click to show internal directories.
Click to hide internal directories.