Documentation ¶
Index ¶
- Variables
- func App() *buffalo.App
- func AuthCreate(c buffalo.Context) error
- func AuthDestroy(c buffalo.Context) error
- func AuthGenerateToken(u *models.User) (string, error)
- func CharactersCreate(c buffalo.Context) error
- func CharactersDestroy(c buffalo.Context) error
- func CharactersList(c buffalo.Context) error
- func CharactersShow(c buffalo.Context) error
- func CharactersUpdate(c buffalo.Context) error
- func HomeHandler(c buffalo.Context) error
- func UsersCreate(c buffalo.Context) error
- type CampaignsResource
- type LevelsResource
- type MapsResource
- type QuestsResource
- type TileCategoriesResource
- func (v TileCategoriesResource) Create(c buffalo.Context) error
- func (v TileCategoriesResource) Destroy(c buffalo.Context) error
- func (v TileCategoriesResource) List(c buffalo.Context) error
- func (v TileCategoriesResource) Show(c buffalo.Context) error
- func (v TileCategoriesResource) Update(c buffalo.Context) error
Constants ¶
This section is empty.
Variables ¶
var ENV = envy.Get("GO_ENV", "development")
ENV is used to help switch settings based on where the application is being run. Default is "development".
Functions ¶
func App ¶
App is where all routes and middleware for buffalo should be defined. This is the nerve center of your application.
Routing, middleware, groups, etc... are declared TOP -> DOWN. This means if you add a middleware to `app` *after* declaring a group, that group will NOT have that new middleware. The same is true of resource declarations as well.
It also means that routes are checked in the order they are declared. `ServeFiles` is a CATCH-ALL route, so it should always be placed last in the route declarations, as it will prevent routes declared after it to never be called.
func AuthCreate ¶
AuthCreate attempts to log the user in with an existing account. HTTP Method: POST Expected Data:
JSON Object: { "email": string, "password": string }
Return:
401 with verrs 202 with JWT token
func AuthDestroy ¶
AuthDestroy clears the session and logs a user out HTTP Method: DELETE Expected Data:
Header: Authorization
Return:
417 with verrs 202
func CharactersCreate ¶
URI: /v1/characters/new Method: POST Data:
Name: string Description: string
Return:
Success: 201, return Character JSON Error: 409, 500, with errors
func CharactersDestroy ¶
func CharactersList ¶
URI: /v1/characters/ Method: GET Data:
None
Return:
Success: 200, return List: Character JSON Error: 409, with errors
func CharactersShow ¶
URI: /v1/characters/:id Method: GET Data:
id
Return:
Success: 200, return Character JSON Error: 409, with errors
func CharactersUpdate ¶
URI: /v1/characters/:id Method: POST Data:
Name: string Description: string
Return:
Success: 200, return Character JSON Error: 409, with errors
func HomeHandler ¶
HomeHandler is a default handler to serve up a home page.
func UsersCreate ¶
UsersCreate registers a new user with the application. HTTP Method: POST Expected Data:
JSON Object: { "email": string, "password": string }
Return:
401 with verrs 201 with JWT token
Types ¶
type CampaignsResource ¶
CampaignsResource is the resource for the Campaign model
func (CampaignsResource) Create ¶
func (v CampaignsResource) Create(c buffalo.Context) error
Create adds a Campaign to the DB. This function is mapped to the path POST /campaigns
func (CampaignsResource) Destroy ¶
func (v CampaignsResource) Destroy(c buffalo.Context) error
Destroy deletes a Campaign from the DB. This function is mapped to the path DELETE /campaigns/{campaign_id} This API should zero out fields associated with the campaign (characters) This API should destroy all child elements (quests, maps) This API should accept the destroy command, any UI should implement a user check ("Are you sure?")
func (CampaignsResource) List ¶
func (v CampaignsResource) List(c buffalo.Context) error
List gets all Campaigns. This function is mapped to the path GET /campaigns
type LevelsResource ¶
LevelsResource is the resource for the Level model
func (LevelsResource) Create ¶
func (v LevelsResource) Create(c buffalo.Context) error
Create adds a Level to the DB. This function is levelped to the path POST /levels
func (LevelsResource) Destroy ¶
func (v LevelsResource) Destroy(c buffalo.Context) error
Destroy deletes a Level from the DB. This function is levelped to the path DELETE /levels/{level_id}
func (LevelsResource) List ¶
func (v LevelsResource) List(c buffalo.Context) error
List gets all Levels. This function is levelped to the path GET /levels/{quest_id}
type MapsResource ¶
MapsResource is the resource for the Map model
func (MapsResource) Create ¶
func (v MapsResource) Create(c buffalo.Context) error
Create adds a Map to the DB. This function is mapped to the path POST /maps
func (MapsResource) Destroy ¶
func (v MapsResource) Destroy(c buffalo.Context) error
Destroy deletes a Map from the DB. This function is mapped to the path DELETE /maps/{map_id}
func (MapsResource) List ¶
func (v MapsResource) List(c buffalo.Context) error
List gets all Maps. This function is mapped to the path GET /maps/{quest_id}
type QuestsResource ¶
QuestsResource is the resource for the Quest model
func (QuestsResource) Create ¶
func (v QuestsResource) Create(c buffalo.Context) error
Create adds a Quest to the DB. This function is mapped to the path POST /quests
func (QuestsResource) Destroy ¶
func (v QuestsResource) Destroy(c buffalo.Context) error
Destroy deletes a Quest from the DB. This function is mapped to the path DELETE /quests/{quest_id} This API should destroy all child elements (maps) This API should accept the destroy command, any UI should implement a user check ("Are you sure?")
func (QuestsResource) List ¶
func (v QuestsResource) List(c buffalo.Context) error
List gets all Quests. This function is mapped to the path GET /quests/{campaign_id}
type TileCategoriesResource ¶
TileCategorysResource is the resource for the TileCategory model
func (TileCategoriesResource) Create ¶
func (v TileCategoriesResource) Create(c buffalo.Context) error
Create adds a TileCategory to the DB. This function is tile_categoryped to the path POST /tile_categorys
func (TileCategoriesResource) Destroy ¶
func (v TileCategoriesResource) Destroy(c buffalo.Context) error
Destroy deletes a TileCategory from the DB. This function is tile_categoryped to the path DELETE /tile_categorys/{tile_category_id}
func (TileCategoriesResource) List ¶
func (v TileCategoriesResource) List(c buffalo.Context) error
List gets all TileCategorys. This function is tile_categoryped to the path GET /tile_categorys/{tile category id}