Commit 96119b9e authored by Lukas Matt's avatar Lukas Matt

Update api and development docs

related to ganggo/ganggo#50
parent b32fb700
......@@ -3037,5 +3037,94 @@ define({ "api": [
"filename": "app/controllers/user_stream.go",
"groupTitle": "UserStreams endpoint",
"groupDescription": "<p>Viewing, creating and deleting UserStream structures</p>"
},
{
"type": "get",
"url": "/people/:guid/stream",
"title": "Fetch person stream",
"name": "ApiUserStream_ShowPersonStream",
"group": "UserStreams",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "guid",
"description": "<p>Unique global or database ID</p>"
},
{
"group": "Parameter",
"type": "Number",
"optional": true,
"field": "offset",
"description": "<p>Post offset for database</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "fields",
"description": "<p>Display only specific fields, e.g. fields=ID,Person(ID:Profile(ID:ImageUrl)). This will only work on standard format!</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "format",
"description": "<p>On default we will use the standard GangGo output but for compatibility reasons you can choose format &quot;diaspora&quot; as well</p>"
}
]
}
},
"success": {
"examples": [
{
"title": "Success-Response (format=default)",
"content": "HTTP/1.1 200 OK\n{\n \"0\": {\n \"Guid\": \"5b5d5b4f7044e3444db73504e8b08be8\",\n \"ID\": 20,\n \"Text\": \"hi whats up?\\r\\n\\r\\n\",\n [...]\n }\n}",
"type": "json"
},
{
"title": "Success-Response (format=diaspora)",
"content": "HTTP/1.1 200 OK\n[\n {\n \"public\": true,\n \"guid\": \"abe68905a61297a686d675796d6b5169\",\n \"author\": {\n \"id\": 1,\n \"guid\": \"bb9e7958aa201ffbd47852fe83e1a1fa\"\n },\n \"post_type\": \"StatusMessage\",\n \"text\": \"a public post\",\n \"provider_display_name\": \"GangGo\",\n \"created_at\": \"2018-02-03T23:47:35.168488+01:00\"\n }\n]",
"type": "json"
}
]
},
"error": {
"fields": {
"Errors 4xx/5xx": [
{
"group": "Errors",
"type": "String",
"optional": false,
"field": "error",
"description": "<p>Contains the recent error message</p>"
}
]
},
"examples": [
{
"title": "Unauthorized",
"content": "HTTP/1.1 401 Unauthorized\n{\n \"error\": \"[...]\"\n}",
"type": "json"
},
{
"title": "NotFound",
"content": "HTTP/1.1 404 Not Found\n{\n \"error\": \"[...]\"\n}",
"type": "json"
},
{
"title": "ServerError",
"content": "HTTP/1.1 500 Internal Server Error\n{\n \"error\": \"[...]\"\n}",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "app/controllers/user_stream.go",
"groupTitle": "UserStreams endpoint",
"groupDescription": "<p>Viewing, creating and deleting UserStream structures</p>"
}
] });
......@@ -3037,5 +3037,94 @@
"filename": "app/controllers/user_stream.go",
"groupTitle": "UserStreams endpoint",
"groupDescription": "<p>Viewing, creating and deleting UserStream structures</p>"
},
{
"type": "get",
"url": "/people/:guid/stream",
"title": "Fetch person stream",
"name": "ApiUserStream_ShowPersonStream",
"group": "UserStreams",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "guid",
"description": "<p>Unique global or database ID</p>"
},
{
"group": "Parameter",
"type": "Number",
"optional": true,
"field": "offset",
"description": "<p>Post offset for database</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "fields",
"description": "<p>Display only specific fields, e.g. fields=ID,Person(ID:Profile(ID:ImageUrl)). This will only work on standard format!</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "format",
"description": "<p>On default we will use the standard GangGo output but for compatibility reasons you can choose format &quot;diaspora&quot; as well</p>"
}
]
}
},
"success": {
"examples": [
{
"title": "Success-Response (format=default)",
"content": "HTTP/1.1 200 OK\n{\n \"0\": {\n \"Guid\": \"5b5d5b4f7044e3444db73504e8b08be8\",\n \"ID\": 20,\n \"Text\": \"hi whats up?\\r\\n\\r\\n\",\n [...]\n }\n}",
"type": "json"
},
{
"title": "Success-Response (format=diaspora)",
"content": "HTTP/1.1 200 OK\n[\n {\n \"public\": true,\n \"guid\": \"abe68905a61297a686d675796d6b5169\",\n \"author\": {\n \"id\": 1,\n \"guid\": \"bb9e7958aa201ffbd47852fe83e1a1fa\"\n },\n \"post_type\": \"StatusMessage\",\n \"text\": \"a public post\",\n \"provider_display_name\": \"GangGo\",\n \"created_at\": \"2018-02-03T23:47:35.168488+01:00\"\n }\n]",
"type": "json"
}
]
},
"error": {
"fields": {
"Errors 4xx/5xx": [
{
"group": "Errors",
"type": "String",
"optional": false,
"field": "error",
"description": "<p>Contains the recent error message</p>"
}
]
},
"examples": [
{
"title": "Unauthorized",
"content": "HTTP/1.1 401 Unauthorized\n{\n \"error\": \"[...]\"\n}",
"type": "json"
},
{
"title": "NotFound",
"content": "HTTP/1.1 404 Not Found\n{\n \"error\": \"[...]\"\n}",
"type": "json"
},
{
"title": "ServerError",
"content": "HTTP/1.1 500 Internal Server Error\n{\n \"error\": \"[...]\"\n}",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "app/controllers/user_stream.go",
"groupTitle": "UserStreams endpoint",
"groupDescription": "<p>Viewing, creating and deleting UserStream structures</p>"
}
]
......@@ -15,7 +15,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2018-02-05T12:36:41.909Z",
"time": "2018-02-22T01:12:10.798Z",
"url": "http://apidocjs.com",
"version": "0.17.6"
}
......
......@@ -15,7 +15,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2018-02-05T12:36:41.909Z",
"time": "2018-02-22T01:12:10.798Z",
"url": "http://apidocjs.com",
"version": "0.17.6"
}
......
---
title: Configuration
layout: default
navigation_order: 2
---
# Configuration
## Database
### Postgres
To setup Postgres, run the following commands:
{% highlight bash linenos %}
su - postgres
psql postgres
CREATE USER ganggo WITH PASSWORD 'ganggo';
CREATE DATABASE ganggo OWNER ganggo;
GRANT ALL PRIVILEGES ON DATABASE ganggo to ganggo;
\q
{% endhighlight %}
The schema will be applied while booting!
### MSSQL
TODO: Contributions are welcome!
### MySQL
TODO: Contributions are welcome!
### SQLite
TODO: Contributions are welcome!
......@@ -19,40 +19,40 @@ After downloading and installing both dependencies do not forget to setup your g
This will ensure that all source files and binaries will be placed in `$GOPATH` and will be available in your shell via your `$PATH`-variable.
# Workspace
Building a development environment requires fetching the sources first:
{% highlight bash linenos %}
go get -d github.com/ganggo/ganggo
{% endhighlight %}
Finally we can execute `make` to fetch the rest of the npm/GoLang dependencies:
{% highlight bash linenos %}
VERSION=v0 make install
cd $GOPATH/src/github.com/ganggo/ganggo && make install
{% endhighlight %}
Depending on your internet connection, that could take a while.
# Workspace
Assuming we want to work on the API, Federation and application server we should
create a workspace first:
That's it! You can switch into `$GOPATH/src/github.com/ganggo/ganggo` apply your changes and start the web-server by running:
{% highlight bash linenos %}
mkdir -p ~/workspace/ganggo
cd ~/workspace/ganggo
git clone --depth=1 https://github.com/ganggo/ganggo
git clone --depth=1 https://github.com/ganggo/api
git clone --depth=1 https://github.com/ganggo/federation
revel run github.com/ganggo/ganggo
{% endhighlight %}
Since `go build` will only build within `$GOPATH` we remove the previouse downloaded libs and create three symlinks to our workspace:
## Unit tests
Running unit tests can be achieved by simply executing `make`
{% highlight bash linenos %}
rm -r $GOPATH/src/gopkg.in/ganggo/ganggo.v0 $GOPATH/src/gopkg.in/ganggo/api.v0 $GOPATH/src/gopkg.in/ganggo/federation.v0
ln -s $GOPATH/src/gopkg.in/ganggo/ganggo.v0 ~/workspace/ganggo/ganggo
ln -s $GOPATH/src/gopkg.in/ganggo/api.v0 ~/workspace/ganggo/api
ln -s $GOPATH/src/gopkg.in/ganggo/federation.v0 ~/workspace/ganggo/federation
make test
{% endhighlight %}
That's it! You can switch into `~/workspace/ganggo/ganggo` now and start the web-server by running:
or alternatively `revel`:
{% highlight bash linenos %}
revel run gopkg.in/ganggo/ganggo.v0
revel test github.com/ganggo/ganggo
{% endhighlight %}
## Updater
......@@ -62,5 +62,3 @@ Assuming you already installed all dependencies and followed the above examples
{% highlight bash linenos %}
VERSION=v0 make release
{% endhighlight %}
The `VERSION` flag is used to identify different software versions via [gopkg.in](http://gopkg.in).
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment