Aura.Repos (Aura v0.9.3)

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

Functions

get_repo(repo_name, opts \\ [])

@spec get_repo(repo_name :: Aura.Common.repo_name(), opts :: list()) ::
  {:ok, Aura.Model.HexRepo.t()} | {:error, any()}

Grabs a hex repo associated with a given repo_name

๐Ÿท๏ธ Params

๐Ÿ’ป 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"

๐Ÿ‘ฉโ€๐Ÿ’ป API Details

MethodPathControllerAction
GET/repos/:repo_nameRepositoryController:show

list_repos(opts \\ [])

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

Grabs hex repos that the user can see

๐Ÿท๏ธ Params

  • opts :: option parameters used to modify requests

โคต๏ธ Returns

โœ… On Success

  {:ok, [%HexRepo{...}]}

โŒ On Failure

  {:error, (some error)}

๐Ÿ’ป 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"

๐Ÿ‘ฉโ€๐Ÿ’ป API Details

MethodPathControllerAction
GET/reposRepositoryController:index