Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,12 @@ STORAGE_HANDLERNAME=postgresql
STORAGE_URL=mongodb://localhost:27017
STORAGE_DATABASE=go_lms
ADDRESS=0.0.0.0:3000
REDIS_HOST=redis
REDIS_HOST=redis

CLIENT_ORIGIN=http://localhost:3000

EMAIL_FROM=eyasubirhanu0@gmail.com
SMTP_HOST=smtp.mailtrap.io
SMTP_USER=
SMTP_PASS=
SMTP_PORT=2525
171 changes: 171 additions & 0 deletions cmd/api/docs/docs.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
// Package docs GENERATED BY SWAG; DO NOT EDIT
// This file was generated by swaggo/swag
package docs

import "github.com/swaggo/swag"

const docTemplate = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"termsOfService": "GO-LMS.com",
"contact": {
"name": "API Support",
"url": "http://GO-LMS.com/support",
"email": "GO-LMS@swagger.io"
},
"license": {
"name": "MIT",
"url": "https://opensource.org/licenses/MIT"
},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/register": {
"post": {
"description": "creates user directory",
"consumes": [
"application/json"
],
"tags": [
"Users"
],
"summary": "Registers a user",
"parameters": [
{
"description": "The body to create a user",
"name": "Body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.UserCreateRequest"
}
}
],
"responses": {
"200": {
"description": "success",
"schema": {
"type": "string"
}
},
"400": {
"description": "error",
"schema": {
"type": "string"
}
},
"404": {
"description": "error",
"schema": {
"type": "string"
}
},
"500": {
"description": "error",
"schema": {
"type": "string"
}
}
}
}
},
"/verifyemail/{verification_code}": {
"get": {
"description": "verificationCode varifay a user",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"users"
],
"summary": "Verify a user",
"parameters": [
{
"type": "string",
"description": "verificationCode",
"name": "verification_code",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "success",
"schema": {
"type": "string"
}
},
"400": {
"description": "error",
"schema": {
"type": "string"
}
}
}
}
}
},
"definitions": {
"handlers.UserCreateRequest": {
"type": "object",
"required": [
"email",
"name",
"password",
"password_confirm"
],
"properties": {
"email": {
"type": "string",
"example": "groot@golms.com"
},
"name": {
"type": "string",
"example": "Groot"
},
"password": {
"type": "string",
"example": "GrootSecret"
},
"password_confirm": {
"type": "string",
"example": "GrootSecret"
}
}
}
},
"securityDefinitions": {
"ApiKeyAuth": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
},
"BasicAuth": {
"type": "basic"
}
}
}`

// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "1.0",
Host: "localhost:3001",
BasePath: "/v1",
Schemes: []string{},
Title: "GO-LMS service API",
Description: "This is GO-LMS server.",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
}

func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}
148 changes: 148 additions & 0 deletions cmd/api/docs/swagger.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
{
"swagger": "2.0",
"info": {
"description": "This is GO-LMS server.",
"title": "GO-LMS service API",
"termsOfService": "GO-LMS.com",
"contact": {
"name": "API Support",
"url": "http://GO-LMS.com/support",
"email": "GO-LMS@swagger.io"
},
"license": {
"name": "MIT",
"url": "https://opensource.org/licenses/MIT"
},
"version": "1.0"
},
"host": "localhost:3001",
"basePath": "/v1",
"paths": {
"/register": {
"post": {
"description": "creates user directory",
"consumes": [
"application/json"
],
"tags": [
"Users"
],
"summary": "Registers a user",
"parameters": [
{
"description": "The body to create a user",
"name": "Body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.UserCreateRequest"
}
}
],
"responses": {
"200": {
"description": "success",
"schema": {
"type": "string"
}
},
"400": {
"description": "error",
"schema": {
"type": "string"
}
},
"404": {
"description": "error",
"schema": {
"type": "string"
}
},
"500": {
"description": "error",
"schema": {
"type": "string"
}
}
}
}
},
"/verifyemail/{verification_code}": {
"get": {
"description": "verificationCode varifay a user",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"users"
],
"summary": "Verify a user",
"parameters": [
{
"type": "string",
"description": "verificationCode",
"name": "verification_code",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "success",
"schema": {
"type": "string"
}
},
"400": {
"description": "error",
"schema": {
"type": "string"
}
}
}
}
}
},
"definitions": {
"handlers.UserCreateRequest": {
"type": "object",
"required": [
"email",
"name",
"password",
"password_confirm"
],
"properties": {
"email": {
"type": "string",
"example": "groot@golms.com"
},
"name": {
"type": "string",
"example": "Groot"
},
"password": {
"type": "string",
"example": "GrootSecret"
},
"password_confirm": {
"type": "string",
"example": "GrootSecret"
}
}
}
},
"securityDefinitions": {
"ApiKeyAuth": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
},
"BasicAuth": {
"type": "basic"
}
}
}
Loading