-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/gbaeke/go-template into main
- Loading branch information
Showing
8 changed files
with
343 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT | ||
// This file was generated by swaggo/swag | ||
|
||
package docs | ||
|
||
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": { | ||
"name": "Source Code", | ||
"url": "https://github.com/gbaeke/go-template" | ||
}, | ||
"version": "{{.Version}}" | ||
}, | ||
"host": "{{.Host}}", | ||
"basePath": "{{.BasePath}}", | ||
"paths": { | ||
"/healthz": { | ||
"get": { | ||
"description": "Kubernetes uses this as liveness probe", | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"summary": "Liveness probe", | ||
"responses": { | ||
"200": { | ||
"description": "ok", | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/readyz": { | ||
"get": { | ||
"description": "Kubernetes uses this as readiness probe", | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"summary": "Readiness probe", | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"schema": { | ||
"type": "boolean" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}` | ||
|
||
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: "0.1", | ||
Host: "localhost:8080", | ||
BasePath: "/", | ||
Schemes: []string{"http", "https"}, | ||
Title: "go-template API", | ||
Description: "Go template", | ||
} | ||
|
||
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{}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"schemes": [ | ||
"http", | ||
"https" | ||
], | ||
"swagger": "2.0", | ||
"info": { | ||
"description": "Go template", | ||
"title": "go-template API", | ||
"contact": { | ||
"name": "Source Code", | ||
"url": "https://github.com/gbaeke/go-template" | ||
}, | ||
"version": "0.1" | ||
}, | ||
"host": "localhost:8080", | ||
"basePath": "/", | ||
"paths": { | ||
"/healthz": { | ||
"get": { | ||
"description": "Kubernetes uses this as liveness probe", | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"summary": "Liveness probe", | ||
"responses": { | ||
"200": { | ||
"description": "ok", | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/readyz": { | ||
"get": { | ||
"description": "Kubernetes uses this as readiness probe", | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"summary": "Readiness probe", | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"schema": { | ||
"type": "boolean" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
basePath: / | ||
host: localhost:8080 | ||
info: | ||
contact: | ||
name: Source Code | ||
url: https://github.com/gbaeke/go-template | ||
description: Go template | ||
title: go-template API | ||
version: "0.1" | ||
paths: | ||
/healthz: | ||
get: | ||
consumes: | ||
- application/json | ||
description: Kubernetes uses this as liveness probe | ||
responses: | ||
"200": | ||
description: ok | ||
schema: | ||
type: string | ||
summary: Liveness probe | ||
/readyz: | ||
get: | ||
consumes: | ||
- application/json | ||
description: Kubernetes uses this as readiness probe | ||
responses: | ||
"200": | ||
description: OK | ||
schema: | ||
type: boolean | ||
summary: Readiness probe | ||
schemes: | ||
- http | ||
- https | ||
swagger: "2.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters