You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
654 lines
18 KiB
654 lines
18 KiB
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
|
// This file was generated by swaggo/swag
|
|
|
|
package swagger
|
|
|
|
import (
|
|
"bytes"
|
|
"encoding/json"
|
|
"strings"
|
|
|
|
"github.com/alecthomas/template"
|
|
"github.com/swaggo/swag"
|
|
)
|
|
|
|
var doc = `{
|
|
"schemes": {{ marshal .Schemes }},
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "{{.Description}}",
|
|
"title": "{{.Title}}",
|
|
"contact": {},
|
|
"license": {},
|
|
"version": "{{.Version}}"
|
|
},
|
|
"host": "{{.Host}}",
|
|
"basePath": "{{.BasePath}}",
|
|
"paths": {
|
|
"/api/character/{seed}": {
|
|
"get": {
|
|
"produces": [
|
|
"application/json",
|
|
" text/plain"
|
|
],
|
|
"tags": [
|
|
"character"
|
|
],
|
|
"summary": "Generate a specific player character using a seed",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Int64",
|
|
"name": "seed",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/tables.Character"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/city/{seed}": {
|
|
"get": {
|
|
"produces": [
|
|
"application/json",
|
|
" text/plain"
|
|
],
|
|
"tags": [
|
|
"city"
|
|
],
|
|
"summary": "Generate a specific city using a seed",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Int64",
|
|
"name": "seed",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/tables.City"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/dungeon/{seed}": {
|
|
"get": {
|
|
"produces": [
|
|
"application/json",
|
|
" text/plain"
|
|
],
|
|
"tags": [
|
|
"dungeon"
|
|
],
|
|
"summary": "Generate a specific dungeon using a seed",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Int64",
|
|
"name": "seed",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/tables.Maze"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/generate/catastrophe": {
|
|
"get": {
|
|
"produces": [
|
|
"application/json",
|
|
" text/plain"
|
|
],
|
|
"tags": [
|
|
"magic"
|
|
],
|
|
"summary": "Generate a catastrophe",
|
|
"responses": {
|
|
"200": {}
|
|
}
|
|
}
|
|
},
|
|
"/api/generate/character": {
|
|
"get": {
|
|
"produces": [
|
|
"application/json",
|
|
" text/plain"
|
|
],
|
|
"tags": [
|
|
"character"
|
|
],
|
|
"summary": "Generate a player character",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/tables.Character"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/generate/city": {
|
|
"get": {
|
|
"produces": [
|
|
"application/json",
|
|
" text/plain"
|
|
],
|
|
"tags": [
|
|
"city"
|
|
],
|
|
"summary": "Generate a city",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/tables.City"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/generate/dungeon": {
|
|
"get": {
|
|
"produces": [
|
|
"application/json",
|
|
" text/plain"
|
|
],
|
|
"tags": [
|
|
"dungeon"
|
|
],
|
|
"summary": "Generate a dungeon",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/tables.Maze"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/generate/insanity": {
|
|
"get": {
|
|
"produces": [
|
|
"application/json",
|
|
" text/plain"
|
|
],
|
|
"tags": [
|
|
"magic"
|
|
],
|
|
"summary": "Generate a insanity",
|
|
"responses": {
|
|
"200": {}
|
|
}
|
|
}
|
|
},
|
|
"/api/generate/monster": {
|
|
"get": {
|
|
"produces": [
|
|
"application/json",
|
|
" text/plain"
|
|
],
|
|
"tags": [
|
|
"monster"
|
|
],
|
|
"summary": "Generate a monster",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/tables.Monster"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/generate/mutation": {
|
|
"get": {
|
|
"produces": [
|
|
"application/json",
|
|
" text/plain"
|
|
],
|
|
"tags": [
|
|
"magic"
|
|
],
|
|
"summary": "Generate a mutation",
|
|
"responses": {
|
|
"200": {}
|
|
}
|
|
}
|
|
},
|
|
"/api/generate/name": {
|
|
"get": {
|
|
"produces": [
|
|
"application/json",
|
|
" text/plain"
|
|
],
|
|
"tags": [
|
|
"character"
|
|
],
|
|
"summary": "Generate a character name",
|
|
"responses": {
|
|
"200": {}
|
|
}
|
|
}
|
|
},
|
|
"/api/generate/spell": {
|
|
"get": {
|
|
"produces": [
|
|
"application/json",
|
|
" text/plain"
|
|
],
|
|
"tags": [
|
|
"magic"
|
|
],
|
|
"summary": "Generate a spell",
|
|
"responses": {
|
|
"200": {}
|
|
}
|
|
}
|
|
},
|
|
"/api/monster/{seed}": {
|
|
"get": {
|
|
"produces": [
|
|
"application/json",
|
|
" text/plain"
|
|
],
|
|
"tags": [
|
|
"monster"
|
|
],
|
|
"summary": "Generate a specific monster using a seed",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Int64",
|
|
"name": "seed",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/tables.Monster"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/roll/{xdy}": {
|
|
"get": {
|
|
"produces": [
|
|
"application/json",
|
|
" text/plain"
|
|
],
|
|
"tags": [
|
|
"dice"
|
|
],
|
|
"summary": "Roll some dice",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Roll in xdy format (e.g. 1d6)",
|
|
"name": "xdy",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"tables.Building": {
|
|
"type": "object",
|
|
"properties": {
|
|
"rooms": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"tacticalFeature": {
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"tables.Character": {
|
|
"type": "object",
|
|
"properties": {
|
|
"appearance": {
|
|
"type": "string"
|
|
},
|
|
"background": {
|
|
"type": "string"
|
|
},
|
|
"clothing": {
|
|
"type": "string"
|
|
},
|
|
"feature": {
|
|
"type": "string"
|
|
},
|
|
"items": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"mannerism": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"personality": {
|
|
"type": "string"
|
|
},
|
|
"physical_detail": {
|
|
"type": "string"
|
|
},
|
|
"seed": {
|
|
"type": "integer"
|
|
},
|
|
"stats": {
|
|
"type": "object",
|
|
"$ref": "#/definitions/tables.CharacterStats"
|
|
},
|
|
"weapons": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tables.CharacterStats": {
|
|
"type": "object",
|
|
"properties": {
|
|
"armor": {
|
|
"type": "integer"
|
|
},
|
|
"dex": {
|
|
"type": "integer"
|
|
},
|
|
"max_health": {
|
|
"type": "integer"
|
|
},
|
|
"str": {
|
|
"type": "integer"
|
|
},
|
|
"wil": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"tables.City": {
|
|
"type": "object",
|
|
"properties": {
|
|
"activities": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"districtThemes": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"events": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"factions": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/tables.Faction"
|
|
}
|
|
},
|
|
"lowerClassBuildings": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/tables.Building"
|
|
}
|
|
},
|
|
"seed": {
|
|
"type": "integer"
|
|
},
|
|
"tacticalStreetFeatures": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"theme": {
|
|
"type": "string"
|
|
},
|
|
"upperClassBuildings": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/tables.Building"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tables.Faction": {
|
|
"type": "object",
|
|
"properties": {
|
|
"goal": {
|
|
"type": "string"
|
|
},
|
|
"trait": {
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"tables.Maze": {
|
|
"type": "object",
|
|
"properties": {
|
|
"activities": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"entrance": {
|
|
"type": "string"
|
|
},
|
|
"form": {
|
|
"type": "string"
|
|
},
|
|
"hazards": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"layout": {
|
|
"type": "string"
|
|
},
|
|
"reward": {
|
|
"type": "string"
|
|
},
|
|
"rooms": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"ruination": {
|
|
"type": "string"
|
|
},
|
|
"trapEffects": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"trapTriggers": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"tricks": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tables.Monster": {
|
|
"type": "object",
|
|
"properties": {
|
|
"ability": {
|
|
"type": "string"
|
|
},
|
|
"base": {
|
|
"type": "string"
|
|
},
|
|
"feature": {
|
|
"type": "string"
|
|
},
|
|
"personality": {
|
|
"type": "string"
|
|
},
|
|
"seed": {
|
|
"type": "integer"
|
|
},
|
|
"stats": {
|
|
"type": "object",
|
|
"$ref": "#/definitions/tables.MonsterStats"
|
|
},
|
|
"tactics": {
|
|
"type": "string"
|
|
},
|
|
"trait": {
|
|
"type": "string"
|
|
},
|
|
"weakness": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"tables.MonsterStat": {
|
|
"type": "object",
|
|
"properties": {
|
|
"qualifier": {
|
|
"type": "string"
|
|
},
|
|
"value": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"tables.MonsterStats": {
|
|
"type": "object",
|
|
"properties": {
|
|
"armor": {
|
|
"type": "object",
|
|
"$ref": "#/definitions/tables.MonsterStat"
|
|
},
|
|
"attack": {
|
|
"type": "object",
|
|
"$ref": "#/definitions/tables.MonsterStat"
|
|
},
|
|
"dex": {
|
|
"type": "object",
|
|
"$ref": "#/definitions/tables.MonsterStat"
|
|
},
|
|
"health": {
|
|
"type": "object",
|
|
"$ref": "#/definitions/tables.MonsterStat"
|
|
},
|
|
"str": {
|
|
"type": "object",
|
|
"$ref": "#/definitions/tables.MonsterStat"
|
|
},
|
|
"wil": {
|
|
"type": "object",
|
|
"$ref": "#/definitions/tables.MonsterStat"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}`
|
|
|
|
type swaggerInfo struct {
|
|
Version string
|
|
Host string
|
|
BasePath string
|
|
Schemes []string
|
|
Title string
|
|
Description string
|
|
}
|
|
|
|
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
|
var SwaggerInfo = swaggerInfo{
|
|
Version: "",
|
|
Host: "",
|
|
BasePath: "/",
|
|
Schemes: []string{},
|
|
Title: "Maze Rats API",
|
|
Description: "",
|
|
}
|
|
|
|
type s struct{}
|
|
|
|
func (s *s) ReadDoc() string {
|
|
sInfo := SwaggerInfo
|
|
sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
|
|
|
|
t, err := template.New("swagger_info").Funcs(template.FuncMap{
|
|
"marshal": func(v interface{}) string {
|
|
a, _ := json.Marshal(v)
|
|
return string(a)
|
|
},
|
|
}).Parse(doc)
|
|
if err != nil {
|
|
return doc
|
|
}
|
|
|
|
var tpl bytes.Buffer
|
|
if err := t.Execute(&tpl, sInfo); err != nil {
|
|
return doc
|
|
}
|
|
|
|
return tpl.String()
|
|
}
|
|
|
|
func init() {
|
|
swag.Register(swag.Name, &s{})
|
|
}
|
|
|