Aura.Repos (Aura v1.0.1)
View SourceService module for interacting with Hex repos
Resources
- Hex
- Contact the maintainer (he's happy to help!)
Summary
Types
@type repo_opts() :: [{:repo_url, Aura.Common.repo_url()}]
Functions
@spec get_repo(repo_name :: Aura.Common.repo_name(), opts :: repo_opts()) :: {:ok, Aura.Model.HexRepo.t()} | {:error, any()}
Grabs a hex repo associated with a given repo_name
Parameters
Parameter | Description |
---|---|
repo_name | Aura.Common.repo_name/0 |
opts[:repo_url] | Aura.Common.repo_url/0 |
API Details
Method | Path | Controller | Action |
---|---|---|---|
GET | /repos/:repo_name | RepositoryController | :show |
Examples
iex> alias Aura.Repos
iex> repo_url = "http://localhost:4000/api"
iex> {:ok, hexpm} = Repos.get_repo("hexpm", repo_url: repo_url)
iex> hexpm.name
"hexpm"
@spec list_repos(opts :: repo_opts()) :: {:ok, [Aura.Model.HexRepo.t()]} | {:error, any()}
Grabs hex repos that the user can see
Parameters
Parameter | Description |
---|---|
opts[:repo_url] | Aura.Common.repo_url/0 |
API Details
Method | Path | Controller | Action |
---|---|---|---|
GET | /repos | RepositoryController | :index |
Examples
iex> alias Aura.Repos
iex> repo_url = "http://localhost:4000/api"
iex> {:ok, [hexpm |_ ]} = Repos.list_repos(repo_url: repo_url)
iex> hexpm.name
"hexpm"