trimmed old functions

Signed-off-by: Michael <michael.lindman@gmail.com>
This commit is contained in:
Michael 2020-08-30 01:24:28 +01:00
parent 5af5f3d277
commit 9a7e759260
1 changed files with 0 additions and 19 deletions

View File

@ -11,9 +11,6 @@ import (
"net/http"
"os"
"path"
"strconv"
"github.com/fatih/color"
)
// IP returns IP address from requester
@ -29,22 +26,6 @@ func IP(r *http.Request) (net.IP, error) {
return net.ParseIP(ip), nil
}
// ColourStatus colour code statuscodes
func ColourStatus(statuscode int) string {
status := color.GreenString(strconv.Itoa(statuscode))
switch {
case statuscode == 200:
status = color.GreenString(strconv.Itoa(statuscode))
case statuscode >= 500 && statuscode <= 511:
status = color.RedString(strconv.Itoa(statuscode))
case statuscode >= 400 && statuscode <= 451:
status = color.YellowString(strconv.Itoa(statuscode))
default:
status = color.MagentaString(strconv.Itoa(statuscode))
}
return status
}
// Hostname returns hostname
func Hostname(ip net.IP) ([]string, error) {
names, err := net.LookupAddr(ip.String())