feat(init): continue on template
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
3
templates/go-swagger/Readme.md.tmpl
Normal file
3
templates/go-swagger/Readme.md.tmpl
Normal file
@ -0,0 +1,3 @@
|
||||
# {{ .ProjectName }}
|
||||
|
||||
{{ .ProjectDescription }}
|
13
templates/go-swagger/api.yaml.tmpl
Normal file
13
templates/go-swagger/api.yaml.tmpl
Normal file
@ -0,0 +1,13 @@
|
||||
---
|
||||
swagger: "2.0"
|
||||
info:
|
||||
version: "1.0"
|
||||
title: "{{ .ProjectName }}"
|
||||
description: "{{ .ProjectDescription }}"
|
||||
contact:
|
||||
email: "{{ .ProjectOwner }}"
|
||||
consumes:
|
||||
- "application/json"
|
||||
produces:
|
||||
- "application/json"
|
||||
basePath: "/"
|
25
templates/go-swagger/api/001-general.yaml.tmpl
Normal file
25
templates/go-swagger/api/001-general.yaml.tmpl
Normal file
@ -0,0 +1,25 @@
|
||||
---
|
||||
definitions:
|
||||
#
|
||||
# GENERAL TYPEs
|
||||
#
|
||||
Error:
|
||||
type: object
|
||||
properties:
|
||||
code:
|
||||
type: integer
|
||||
format: int64
|
||||
message:
|
||||
type: string
|
||||
Metadata:
|
||||
type: object
|
||||
required:
|
||||
- this
|
||||
- total
|
||||
properties:
|
||||
total:
|
||||
type: integer
|
||||
format: int64
|
||||
this:
|
||||
type: integer
|
||||
format: int64
|
48
templates/go-swagger/api/002-monitoring.yaml.tmpl
Normal file
48
templates/go-swagger/api/002-monitoring.yaml.tmpl
Normal file
@ -0,0 +1,48 @@
|
||||
---
|
||||
tags:
|
||||
- name: Monitoring
|
||||
description: Monitoring routes
|
||||
definitions:
|
||||
MonPing:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
type: object
|
||||
x-nullable: true
|
||||
properties:
|
||||
database:
|
||||
type: boolean
|
||||
description: State of the database
|
||||
application:
|
||||
type: boolean
|
||||
description: State of the application
|
||||
details:
|
||||
type: object
|
||||
x-nullable: true
|
||||
properties:
|
||||
app_version:
|
||||
type: string
|
||||
description: Application version
|
||||
git_hash:
|
||||
type: string
|
||||
description: Git hash of the last commit
|
||||
paths:
|
||||
#
|
||||
# SECTION : MONITORING
|
||||
#
|
||||
/mon/ping:
|
||||
get:
|
||||
tags:
|
||||
- Monitoring
|
||||
summary: Health check
|
||||
description: Return Health status of the app with additionnal info such as the version
|
||||
operationId: getMonPing
|
||||
responses:
|
||||
200:
|
||||
description: Health OK
|
||||
schema:
|
||||
$ref: "#/definitions/MonPing"
|
||||
default:
|
||||
description: Default error message
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
Reference in New Issue
Block a user