Skip to content

microlib/usermanager

Repository files navigation

User Manager

Build Status codecov Go Report Card GoDoc

Endpoint: /users

Request

HTTP verbs: http://www.restapitutorial.com/lessons/httpmethods.html

POST: create

required fields

  • name
  • email
  • password

optional fields

none

GET: read

  • single user: /users/{id}
  • users: /users

required fields

none

optional fields

  • name
  • email

DELETE: delete

  • single user: /users/{id}
  • users: /users

required fields

none

optional fields

  • name
  • email

PUT: update (replacement)

  • single user: /users/{id}

required fields

  • id
  • name
  • email
  • password

optional fields

none

PATCH: partial update

  • single user: /users/{id}

required fields

  • id

optional fields

  • name
  • email
  • password

Response

single resource

{
  "data": {
    "type": "users",
    "id": "1",
    "attributes": {
      "name": "john",
      "email": "john@thesmithcompany.com",
      "password": "ja8q\+Y!?FCD3":P"
    }
  }
}

multiple resources

{
  "data": [{
    "type": "users",
    "id": "1",
    "attributes": {
      "name": "john",
      "email": "john@thesmithcompany.com",
      "password": "ja8q\+Y!?FCD3\":P"
    }
  }, 
  {
    "type": "users",
    "id": "2",
    "attributes": {
      "name": "bob",
      "email": "bob@hello.co.uk",
      "password": "ja8q\+Y!?FCD3(:P"
    }
  }]
}

Installation

The dependencies of this project are stored inside the vendor/ folder. While we use gvt to manage the dependencies, we're also pushing them anyway, so that users can feel free to simply run go get to get the dependencies.

Keep in mind that the vendor/ folder can only be used for dependencies out-of-the-box if you're running Go 1.6 or higher. It is also available on Go 1.5 but you will need to enable the environment variable GO15VENDOREXPERIMENT and set it to 1.

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published