init project

This commit is contained in:
2024-09-17 08:40:20 +07:00
parent 0612390e55
commit 73ff9c10bc
11 changed files with 824 additions and 0 deletions

79
docs/docs.go Normal file
View File

@@ -0,0 +1,79 @@
// 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": {},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/api/v1/user": {
"get": {
"description": "returs list of all users from the database",
"tags": [
"Users"
],
"summary": "return list of all",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.User"
}
}
}
}
}
},
"definitions": {
"models.User": {
"type": "object",
"properties": {
"agama": {
"type": "string"
},
"alamat": {
"type": "string"
},
"id": {
"type": "string"
},
"jenis_kelamin": {
"type": "string"
},
"nama": {
"type": "string"
},
"umur": {
"type": "integer"
}
}
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "1",
Host: "localhost:8080",
BasePath: "",
Schemes: []string{},
Title: "Crud User",
Description: "Rest API CRUD User",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}

54
docs/swagger.json Normal file
View File

@@ -0,0 +1,54 @@
{
"swagger": "2.0",
"info": {
"description": "Rest API CRUD User",
"title": "Crud User",
"contact": {},
"version": "1"
},
"host": "localhost:8080",
"paths": {
"/api/v1/user": {
"get": {
"description": "returs list of all users from the database",
"tags": [
"Users"
],
"summary": "return list of all",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.User"
}
}
}
}
}
},
"definitions": {
"models.User": {
"type": "object",
"properties": {
"agama": {
"type": "string"
},
"alamat": {
"type": "string"
},
"id": {
"type": "string"
},
"jenis_kelamin": {
"type": "string"
},
"nama": {
"type": "string"
},
"umur": {
"type": "integer"
}
}
}
}
}

35
docs/swagger.yaml Normal file
View File

@@ -0,0 +1,35 @@
definitions:
models.User:
properties:
agama:
type: string
alamat:
type: string
id:
type: string
jenis_kelamin:
type: string
nama:
type: string
umur:
type: integer
type: object
host: localhost:8080
info:
contact: {}
description: Rest API CRUD User
title: Crud User
version: "1"
paths:
/api/v1/user:
get:
description: returs list of all users from the database
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.User'
summary: return list of all
tags:
- Users
swagger: "2.0"