An Elixir wrapper for the Gitlab API
Status
Until further notice the Lab API is unstable and very much subject to change :)
Installation
Add lab to your list of dependencies in mix.exs:
def deps do
[
{:lab, "~> 0.1"}
]
end
Usage
Set your gitlab api endpoint in your mix config :
config :lab,
gitlab_api_endpoint: "https://git.lab/api/v4"
Or in your environment:
export GITLAB_API_ENDPOINT=https://git.lab/api/v4
Set your Gitlab API private token in your enviroment:
export GITLAB_API_PRIVATE_TOKEN=token
Examples
# All projects returned as list of %Lab.Project{}
{:ok, projects } = Lab.all(Project)
# All Gitlab API resource options supported by default
{:ok, projects } = Lab.all(Project, per_page: 5)
# Single Project returned as %Lab.Project{}
{:ok, project } = Lab.get(Project, 1)
See the online documentation for further detail.
Reference
Attributions
- Powered by Tesla
- Inspirado from NARKOZ/gitlab
- Beaker logo provided by cliparts