// Package docs Code generated by swaggo/swag. DO NOT EDIT package docs import "github.com/swaggo/swag" const docTemplate = `{ "schemes": {{ marshal .Schemes }}, "swagger": "2.0", "info": { "description": "{{escape .Description}}", "title": "{{.Title}}", "contact": {}, "license": { "name": "AGPL", "url": "https://www.gnu.org/licenses/agpl-3.0.html" }, "version": "{{.Version}}" }, "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { "/login": { "post": { "description": "Logs in a user and returns a JWT token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "Login", "parameters": [ { "description": "User credentials", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/types.NewUser" } } ], "responses": { "200": { "description": "JWT token", "schema": { "$ref": "#/definitions/types.Token" } }, "400": { "description": "Bad request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "type": "string" } } } } }, "/loginrenew": { "post": { "security": [ { "JWT": [] } ], "description": "Renews the users token.", "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "LoginRenews", "responses": { "200": { "description": "Successfully signed token for user", "schema": { "$ref": "#/definitions/types.Token" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "type": "string" } } } } }, "/promote/{projectName}": { "put": { "security": [ { "JWT": [] } ], "description": "Promote a user to project manager", "consumes": [ "text/plain" ], "produces": [ "text/plain" ], "tags": [ "Auth" ], "summary": "Promote to project manager", "parameters": [ { "type": "string", "description": "Project name", "name": "projectName", "in": "path", "required": true }, { "type": "string", "description": "User name", "name": "userName", "in": "query", "required": true } ], "responses": { "403": { "description": "Forbidden", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "type": "string" } } } } }, "/promoteToAdmin": { "post": { "security": [ { "JWT": [] } ], "description": "Promote chosen user to site admin", "consumes": [ "application/json" ], "produces": [ "text/plain" ], "tags": [ "User" ], "summary": "PromoteToAdmin", "parameters": [ { "description": "user info", "name": "NewUser", "in": "body", "required": true, "schema": { "$ref": "#/definitions/types.NewUser" } } ], "responses": { "200": { "description": "Successfully promoted user", "schema": { "$ref": "#/definitions/types.Token" } }, "400": { "description": "Bad request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "type": "string" } } } } }, "/register": { "post": { "description": "Register a new user", "consumes": [ "application/json" ], "produces": [ "text/plain" ], "tags": [ "Auth" ], "summary": "Register", "parameters": [ { "description": "User to register", "name": "NewUser", "in": "body", "required": true, "schema": { "$ref": "#/definitions/types.NewUser" } } ], "responses": { "200": { "description": "User added", "schema": { "type": "string" } }, "400": { "description": "Bad request", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "type": "string" } } } } }, "/userdelete/{username}": { "delete": { "security": [ { "JWT": [] } ], "description": "UserDelete deletes a user from the database", "consumes": [ "application/json" ], "produces": [ "text/plain" ], "tags": [ "User" ], "summary": "UserDelete", "responses": { "200": { "description": "User deleted", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "403": { "description": "You can only delete yourself", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "type": "string" } } } } }, "/users/all": { "get": { "security": [ { "JWT": [] } ], "description": "lists all users", "produces": [ "application/json" ], "tags": [ "User" ], "summary": "ListsAllUsers", "responses": { "200": { "description": "Successfully returned all users", "schema": { "type": "array", "items": { "type": "string" } } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "type": "string" } } } } } }, "definitions": { "types.NewUser": { "type": "object", "properties": { "password": { "type": "string", "example": "password123" }, "username": { "type": "string", "example": "username123" } } }, "types.Token": { "type": "object", "properties": { "token": { "type": "string" } } } }, "securityDefinitions": { "JWT": { "description": "Use the JWT token provided by the login endpoint to authenticate requests. **Prefix the token with \"Bearer \".**", "type": "apiKey", "name": "Authorization", "in": "header" } }, "externalDocs": { "description": "OpenAPI", "url": "https://swagger.io/resources/open-api/" } }` // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ Version: "0.0.1", Host: "localhost:8080", BasePath: "/api", Schemes: []string{}, Title: "TTime API", Description: "This is the API for TTime, a time tracking application.", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, LeftDelim: "{{", RightDelim: "}}", } func init() { swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) }