README.md

![Lab](assets/logo.png)
=========
[![Hex
Version](https://img.shields.io/hexpm/v/lab.svg)](https://hex.pm/packages/lab)
[![stability-alpha](https://img.shields.io/badge/stability-alpha-orange.svg)]()
[![Travis](https://travis-ci.org/starbelly/lab.svg?branch=master)](https://travis-ci.org/starbelly/lab)
[![coverage Report](https://gitlab.com/starbelly/lab/badges/master/coverage.svg)](https://gitlab.com/starbelly/lab/commits/master)
[![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)]()
[![License](https://img.shields.io/github/license/mashape/apistatus.svg)]()

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
alias Lab.Project

# 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)

# Create a project
{:ok, project } = Lab.create(%Project{name: "my_app"})

# Update a project
{:ok, project } = Lab.update(%Project{name: "better_name"})

# Update a project
Lab.delete(%Project{id: 1})
:ok
```

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)