Categorygithub.com/packetfire/goqdb
module
0.0.0-20140301094619-5707e414171c
Repository: https://github.com/packetfire/goqdb.git
Documentation: pkg.go.dev

# README

goqdb

Quote Database in Go

usage

requirements

running

revel run github.com/PacketFire/goqdb

API

Quote

NameTypeDescription
QuoteIdintThe quote id
QuotestringThe quote body
AuthorstringThe author of the quote
Createdint64unix time in seconds
RatingintThe quote's rating
Tags[]stringAn array of tag strings, white space is trimmed from either side
UserIdstringAuthor's user id hash

All resources return 200 on success or 500 with an undefined body if fatal errors were encountered. Resources requiring an id return a 404 with undefined body if the id does not exist in the database.

Index

GET /api/v1
GET /api/v1/:id

Parameters

idreturn single entry
tagreturn quotes with tag
searchsearch quotes
fromdate string in the form mm/dd/yyyy
tosame as above
sortone of relevence, rating, date, random
descboolean, sort in descending order
sizemaximum amount of entries to return, capped at 4096 by default

Insert a new entry

POST /api/v1

Accepts Quote, Author and Tags fields of a Quote

Request:

POST /api/v0/ HTTP/1.1
Content-Type: application/json
Content-Length: 58

{"Quote": "test", "Author": "jgr", "Tags": ["foo", "bar"]}

Response:

HTTP/1.1 201 Created
Content-Type: application/json	
...

{
  "QuoteId": 20,
  "Quote": "test",
  "Created": 1385395888,
  "Rating": 0,
  "Author": "jgr",
  "Tags": [
    "foo",
    "bar"
 ]
}

Vote

PATCH /api/v1/:id/:typ

Parameters

idtarget id
typone of up, down, delete

# Packages

No description provided by the author
No description provided by the author