summaryrefslogtreecommitdiff
path: root/app/controllers/url.go
diff options
context:
space:
mode:
authorHorus32015-02-10 08:33:42 +0100
committerHorus32015-02-10 08:33:42 +0100
commit8c30749613bcf1ce47fff0a6d1a60c34f91f01c4 (patch)
tree98354473d929cbc9749f08ea0afdf90993a01480 /app/controllers/url.go
parentaf1f4677c685e8a2c4967ffa0350d314a6543db7 (diff)
downloadwebmon-8c30749613bcf1ce47fff0a6d1a60c34f91f01c4.tar.gz
Basic user control.
Diffstat (limited to 'app/controllers/url.go')
-rw-r--r--app/controllers/url.go28
1 files changed, 0 insertions, 28 deletions
diff --git a/app/controllers/url.go b/app/controllers/url.go
deleted file mode 100644
index 516f6a6..0000000
--- a/app/controllers/url.go
+++ /dev/null
@@ -1,28 +0,0 @@
-package controllers
-
-import (
- "crypto/md5"
- "fmt"
- "io"
- "io/ioutil"
- "net/http"
-)
-
-func HashUrl(url string) (string, error) {
- response, err := http.Get(url)
- if err != nil {
- return "Get request failed.", err
- }
-
- defer response.Body.Close()
- contents, err := ioutil.ReadAll(response.Body)
- if er != nil {
- return "Reading body failed.", err
- }
-
- h := md5.New()
- io.WriteString(h, string(contents))
- hash := fmt.Sprintf("%x", h.Sum(nil))
-
- return hash, nil
-}