paas-accounts

command module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2018 License: MIT Imports: 8 Imported by: 0

README

paas-accounts

API for storing information about PaaS users.

Build

go build -o paas-accounts .

Run

BASIC_AUTH_USERNAME="some-user" \
BASIC_AUTH_PASSWORD="some-pass" \
DATABASE_URL="postgres://..." \
PORT=8080 \
	./paas-accounts

Deploy

A manifest.yml exists for deploying to cloudfoundry. You should ensure the required environment variables are in place and that a suitable postgres database service is bound.

API

PUT /documents/:name

Create or update a document:

curl -u <USER>:<PASS> -H "Content-Type: application/json" -X PUT -d '{"content": "my content"}' https://<HOSTNAME>/documents/my_document
GET /documents/:name

Retrieve an existing document:

curl -u <USER>:<PASS> https://<HOSTNAME>/documents/my_document

Agreements

POST /agreements

Record a user's agreement to a document:

curl -u <USER>:<PASS> -H "Content-Type: application/json" -X POST -d '{"user_uuid": "00000000-0000-0000-0000-000000000001", "document_name": "my_document"}' https://<HOSTNAME>/agreements
GET /users/:uuid/documents

Get all documents for a user:

curl -u <USER>:<PASS> https://<HOSTNAME>/users/00000000-0000-0000-0000-000000000001/documents

Get all documents for a user that need agreement:

curl -u <USER>:<PASS> -G -d agreed=false https://<HOSTNAME>/users/00000000-0000-0000-0000-000000000001/documents

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL