Aura.Repos (Aura v1.0.1)

View Source

Service module for interacting with Hex repos

Resources

Summary

Functions

Grabs a hex repo associated with a given repo_name

Grabs hex repos that the user can see

Types

repo_opts()

@type repo_opts() :: [{:repo_url, Aura.Common.repo_url()}]

Functions

get_repo(repo_name, opts \\ [])

@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

ParameterDescription
repo_nameAura.Common.repo_name/0
opts[:repo_url]Aura.Common.repo_url/0

API Details

MethodPathControllerAction
GET/repos/:repo_nameRepositoryController: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"

list_repos(opts \\ [])

@spec list_repos(opts :: repo_opts()) ::
  {:ok, [Aura.Model.HexRepo.t()]} | {:error, any()}

Grabs hex repos that the user can see

Parameters

ParameterDescription
opts[:repo_url]Aura.Common.repo_url/0

API Details

MethodPathControllerAction
GET/reposRepositoryController: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"