Mx.GitHub (mx v0.1.0)

Copy Markdown View Source

Files of public GitHub repositories, downloaded into the user's cache, for samples a song names as {:github, repo, ref, path} and collections downloaded ahead of time.

Each repository and ref has its own folder in the cache, so two refs of one repository never share a file. A file is written under a temporary name and renamed once complete, so an interrupted download never leaves a file that looks downloaded. Files come from GitHub's raw file server, and a folder's files are listed with GitHub's API, which limits requests without a login.

Summary

Functions

The folder GitHub files are cached in: the :github_dir setting, or a folder in the user's cache.

Downloads a file of a repository at a ref into the cache, and returns :ok or {:error, reason}.

The paths of the files in a folder of a repository at a ref, or in the whole repository for nil, as {:ok, paths} or {:error, message}.

Where a file of a repository at a ref is kept in the cache.

Functions

dir()

The folder GitHub files are cached in: the :github_dir setting, or a folder in the user's cache.

fetch(repo, ref, path)

Downloads a file of a repository at a ref into the cache, and returns :ok or {:error, reason}.

list(repo, ref, folder)

The paths of the files in a folder of a repository at a ref, or in the whole repository for nil, as {:ok, paths} or {:error, message}.

local(repo, ref, path)

Where a file of a repository at a ref is kept in the cache.