Add CI and go-report badges. Add comments to make golint happy

This commit is contained in:
2021-11-30 17:21:01 +01:00
parent 9b10052cd1
commit 2d330a99b7
8 changed files with 24 additions and 2 deletions

View File

@ -14,6 +14,7 @@ import (
const userAgentPattern = `curl|wget|libwww-perl|python|ansible-httpget|HTTPie|WindowsPowerShell|http_request|Go-http-client|^$`
// JSONResponse maps data as json
type JSONResponse struct {
IP string `json:"ip"`
IPVersion byte `json:"ip_version"`

View File

@ -8,6 +8,7 @@ import (
"github.com/gin-gonic/gin"
)
// SetupTemplate reads and parses a template from file
func SetupTemplate(r *gin.Engine) {
if setting.App.TemplatePath == "" {
t, _ := template.New("home").Parse(home)
@ -18,6 +19,7 @@ func SetupTemplate(r *gin.Engine) {
}
}
// Setup defines the endpoints
func Setup(r *gin.Engine) {
r.GET("/", getRoot)
r.GET("/client-port", getClientPortAsString)