mirror of
https://github.com/dcarrillo/whatismyip.git
synced 2025-07-01 19:49:27 +00:00
Add CI and go-report badges. Add comments to make golint happy
This commit is contained in:
@ -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"`
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user