top
(README.md)
---
# `/static`

The static service manages a collection of static files, as
well as providing a simple key-value store.

It has a few major parts:

## /key
Manages a set of key/value pairs. Typically used for data that
changes rarely but should still be modifiable, and doesn't
really belong in a database. Often the "value" is actually a
JSON blob of other values, such as a collection of objects for
filling dropdowns in a UI. Could be replaced by static
configuration files but this is a little more powerful and
flexible.

## /id
Provides a service for generating a sequence of non-colliding
sequential IDs, and also keeps track of a mapping from old to
new values (so that it can provide a repeatable mapping).

## /static
Serves content out of a static directory structure.

---




* [PutKey](#putkey)

* [PostKey](#postkey)

* [Keys](#keys)

* [FindKey](#findkey)

* [removeKey](#removekey)

* [GetIDForHash](#getidforhash)

* [GenID](#genid)

* [Status](#status)

* [Static](#static)




---
## PutKey

### `PUT /key/:key/:value`

_store a string value under a key_




_**Parameters:**_

Name | Kind | Description | DataType
---- | ---- | ----------- | --------
 key | Path | key to identify this Entry | string
 value | Path | an arbitrary string value | string









---
## PostKey

### `POST /key/:key`

_store a JSON value under a key_




_**Parameters:**_

Name | Kind | Description | DataType
---- | ---- | ----------- | --------
 key | Path | key to identify this Entry | string









---
## Keys

### `GET /key/keys`

_get the list of keys currently stored_




_**Parameters:**_

Name | Kind | Description | DataType
---- | ---- | ----------- | --------
 filter | Query | pattern to search for; key names that contain it will be returned. | string









---
## FindKey

### `GET /key/:key`

_get the contents of a key_




_**Parameters:**_

Name | Kind | Description | DataType
---- | ---- | ----------- | --------
 key | Path | the key to fetch | string








_**Error returns:**_

Code | Meaning
---- | --------
 404 | Key not found



---
## removeKey

### `DELETE /key/:key`

_delete a key and all its data. Returns the deleted key and tags._




_**Parameters:**_

Name | Kind | Description | DataType
---- | ---- | ----------- | --------
 key | Path | the key to delete | string








_**Error returns:**_

Code | Meaning
---- | --------
 404 | Key not found



---
## GetIDForHash

### `GET /id/:idname/for/:hash`

_Return the ID for the given hash; if it doesn't exist, get the next ID in the given id namespace and store it under the hash_




_**Parameters:**_

Name | Kind | Description | DataType
---- | ---- | ----------- | --------
 idname | Path | the namespace of the ID key to use | string
 hahs | Path | the original value of the thing to generate an id for. Allows repeatable results. | string









---
## GenID

### `GET /id/:idname`

_get the next ID in the given id namespace_




_**Parameters:**_

Name | Kind | Description | DataType
---- | ---- | ----------- | --------
 idname | Path | the namespace of the ID key to use | string









---
## Status

### `GET /status`

_Returns the status of the service._











---
## Static

### `GET /static/*`

_All requests that start with /static are handled by the file server_

The STATICSERVER_ROOT environment variable sets the
root directory for the static server. Note that everything
that Vasco doesn't understand is forwarded as a request to
/static. If you need to use a filename that conflicts with
something that Vasco knows about, you can access it by preceding
its filepath with /static.

In order to support client-side "HTML5 routing", anything
the static server doesn't understand that would normally
return a 404, instead internally redirects to the root
path (/). This typically returns index.html.

Imports 7 package(s) ΒΆ

  1. github.com/AchievementNetwork/go-util/vascoClient
  2. github.com/AchievementNetwork/go-util/util
  3. gopkg.in/mgo.v2/bson
  4. github.com/AchievementNetwork/go-util/boneful
  5. github.com/go-zoo/bone
  6. gopkg.in/mgo.v2
  7. github.com/AchievementNetwork/go-util/mongoHelper