![Lab](assets/logo.png)
=========
[![Hex
Version](https://img.shields.io/hexpm/v/lab.svg)](https://hex.pm/packages/lab)
[![pipeline
status](https://gitlab.com/starbelly/lab/badges/master/pipeline.svg)](https://gitlab.com/starbelly/lab/commits/master)
[![coverage
report](https://gitlab.com/starbelly/lab/badges/master/coverage.svg)](https://gitlab.com/starbelly/lab/commits/master)
[![Travis](https://travis-ci.org/starbelly/lab.svg?branch=master)](https://travis-ci.org/starbelly/lab)
[![Ebert](https://ebertapp.io/github/starbelly/lab.svg)](https://ebertapp.io/github/starbelly/lab)
[![Inline docs](https://inch-ci.org/github/starbelly/lab.svg)](http://inch-ci.org/github/starbelly/lab)
![Size](https://reposs.herokuapp.com/?path=starbelly/lab)
[![stability-experimental](https://img.shields.io/badge/stability-experimental-orange.svg)](https://github.com/emersion/stability-badges#experimental)
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:
```elixir
def deps do
[
{:lab, "~> 0.1"}
]
end
```
## Usage
Set your gitlab api endpoint in your mix config :
```elixir
config :lab,
gitlab_api_endpoint: "https://git.lab/api/v4"
```
Or in your environment:
```shell
export GITLAB_API_ENDPOINT=https://git.lab/api/v4
```
Set your Gitlab API private token in your enviroment:
```shell
export GITLAB_API_PRIVATE_TOKEN=token
```
### Examples
```elixir
# 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](http://hexdocs.pm/lab) for further detail.
## Reference
- [Gitlab API](https://docs.gitlab.com/ee/api/README.html)
## Attributions
- Powered by [Tesla](https://github.com/teamon/tesla)
- Inspirado from [NARKOZ/gitlab](https://github.com/NARKOZ/gitlab)
- Beaker logo provided by [cliparts](https://cliparts.zone)