Skip to content

Commit

Permalink
updating docs
Browse files Browse the repository at this point in the history
  • Loading branch information
esatterwhite committed Dec 29, 2016
1 parent ef744b4 commit fa50aff
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 14 deletions.
40 changes: 37 additions & 3 deletions docs/api_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,34 @@ define({ "api": [
"description": "<p>A full uri the transport should send data to</p>"
}
]
}
},
"examples": [
{
"title": "request:",
"content": "{\n \"timeout\": 3000,\n \"data\": \"Hello world\",\n \"callback\": {\n \"method\": \"put\",\n \"uri\": \"http://mydomain.name/timer/callback\",\n \"tranport\":\"http\"\n }",
"type": "json"
}
]
},
"header": {
"fields": {
"Response Headers": [
{
"group": "Response Headers",
"type": "String",
"optional": false,
"field": "location",
"description": "<p>URI of the created timer which can be used to modify or cancel the timer</p>"
}
]
},
"examples": [
{
"title": "Response Headers:",
"content": "HTTP/1.1 201 CREATED\nLOCATION: /timer/489ea3df-c583-4325-8fb0-0f1ec8301bd9\nDate: Fri, 23 Dec 2016 00:19:13 GMT\nConnection: keep-alive\nContent-Length: 0",
"type": "text"
}
]
},
"examples": [
{
Expand All @@ -71,7 +98,7 @@ define({ "api": [
"groupTitle": "timer"
},
{
"description": "<p>Deletes a timer</p>",
"description": "<p>Deletes a Timer by id from the ring. A request can be issued to any server in the ring.</p>",
"group": "timer",
"name": "delete_timer",
"type": "delete",
Expand All @@ -88,7 +115,14 @@ define({ "api": [
"description": "<p>Users unique ID.</p>"
}
]
}
},
"examples": [
{
"title": "Example id:",
"content": "'8c66a779-9c74-4e30-b5e8-f32d60909d45'",
"type": "text"
}
]
},
"version": "1.0.0",
"examples": [
Expand Down
40 changes: 37 additions & 3 deletions docs/api_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,34 @@
"description": "<p>A full uri the transport should send data to</p>"
}
]
}
},
"examples": [
{
"title": "request:",
"content": "{\n \"timeout\": 3000,\n \"data\": \"Hello world\",\n \"callback\": {\n \"method\": \"put\",\n \"uri\": \"http://mydomain.name/timer/callback\",\n \"tranport\":\"http\"\n }",
"type": "json"
}
]
},
"header": {
"fields": {
"Response Headers": [
{
"group": "Response Headers",
"type": "String",
"optional": false,
"field": "location",
"description": "<p>URI of the created timer which can be used to modify or cancel the timer</p>"
}
]
},
"examples": [
{
"title": "Response Headers:",
"content": "HTTP/1.1 201 CREATED\nLOCATION: /timer/489ea3df-c583-4325-8fb0-0f1ec8301bd9\nDate: Fri, 23 Dec 2016 00:19:13 GMT\nConnection: keep-alive\nContent-Length: 0",
"type": "text"
}
]
},
"examples": [
{
Expand All @@ -71,7 +98,7 @@
"groupTitle": "timer"
},
{
"description": "<p>Deletes a timer</p>",
"description": "<p>Deletes a Timer by id from the ring. A request can be issued to any server in the ring.</p>",
"group": "timer",
"name": "delete_timer",
"type": "delete",
Expand All @@ -88,7 +115,14 @@
"description": "<p>Users unique ID.</p>"
}
]
}
},
"examples": [
{
"title": "Example id:",
"content": "'8c66a779-9c74-4e30-b5e8-f32d60909d45'",
"type": "text"
}
]
},
"version": "1.0.0",
"examples": [
Expand Down
4 changes: 2 additions & 2 deletions docs/api_project.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
define({
"name": "skyring",
"version": "1.0.5",
"version": "2.0.1",
"description": "Distributed timers as a service",
"sampleUrl": false,
"apidoc": "0.2.0",
"generator": {
"name": "apidoc",
"time": "2016-12-27T18:36:42.874Z",
"time": "2016-12-29T21:23:53.302Z",
"url": "http://apidocjs.com",
"version": "0.16.1"
}
Expand Down
4 changes: 2 additions & 2 deletions docs/api_project.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "skyring",
"version": "1.0.5",
"version": "2.0.1",
"description": "Distributed timers as a service",
"sampleUrl": false,
"apidoc": "0.2.0",
"generator": {
"name": "apidoc",
"time": "2016-12-27T18:36:42.874Z",
"time": "2016-12-29T21:23:53.302Z",
"url": "http://apidocjs.com",
"version": "0.16.1"
}
Expand Down
9 changes: 6 additions & 3 deletions lib/server/api/delete_timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,17 @@ module.exports = {
}

/**
* @apiDescription Deletes a timer
* @apiDescription Deletes a Timer by id from the ring.
* A request can be issued to any server in the ring.
* @apiGroup timer
* @apiName delete_timer
* @api {delete} /timer/:id Delete a timer
* @apiParam {Number} id Users unique ID.
* @apiParamExample {text} Example id:
* '8c66a779-9c74-4e30-b5e8-f32d60909d45'
* @apiVersion 1.0.0
* @apiExample {curl} curl:
* curl -XDELETE -H "Content-Type: application/json" http://localhost:3000/timer/8c66a779-9c74-4e30-b5e8-f32d60909d45
* curl -XDELETE -H "Content-Type: application/json" http://localhost:3000/timer/8c66a779-9c74-4e30-b5e8-f32d60909d45
* @apiExample {js} Node.js:
* const http = require('http')
* const options = {
Expand All @@ -57,4 +60,4 @@ module.exports = {
* });
* })
* req.end();
**/
**/
16 changes: 16 additions & 0 deletions lib/server/api/post_timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,22 @@ module.exports = {
* @apiParam {String} callback.transport The delivery transport to use when executing the timer
* @apiParam {String} callback.method The method of delivery the tranport should use
* @apiParam {String} callback.uri A full uri the transport should send data to
* @apiHeader (Response Headers) {String} location URI of the created timer which can be used to modify or cancel the timer
* @apiHeaderExample {text} Headers Example:
* HTTP/1.1 201 CREATED
* LOCATION: /timer/489ea3df-c583-4325-8fb0-0f1ec8301bd9
* Date: Fri, 23 Dec 2016 00:19:13 GMT
* Connection: keep-alive
* Content-Length: 0
* @apiParamExample {json} request:
* {
* "timeout": 3000,
* "data": "Hello world",
* "callback": {
* "method": "put",
* "uri": "http://mydomain.name/timer/callback",
* "tranport":"http"
* }
* @apiExample {curl} curl:
* curl -XPOST -H "Content-Type: application/json" http://localhost:3000/timer -d '{
* "timeout": 3000,
Expand Down
2 changes: 1 addition & 1 deletion lib/timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Manage Timers on a node
* @module skyring/lib/timer
* @author Eric Satterwhite
* @since 1.0.0
* @since 3.0.0
* @requires debug
* @requires skyring/lib/transports
* @requires skyring/lib/nats
Expand Down

0 comments on commit fa50aff

Please sign in to comment.