diff options
| -rw-r--r-- | README | 26 | ||||
| -rw-r--r-- | brokenlinks.go | 16 |
2 files changed, 21 insertions, 21 deletions
@@ -47,9 +47,9 @@ Available commands, { "$PAGE": [{ - "Link": <string>, - "Error": <string>, - "Code": <integer> + "link": <string>, + "error": <string>, + "code": <integer> }, ... ], @@ -67,24 +67,24 @@ Available commands, { "https://kilabit.info/some/page": [ { - "Link": "https://kilabit.info/some/page/image.png", - "Code": 404 + "link": "https://kilabit.info/some/page/image.png", + "code": 404 }, { - "Link": "https://external.com/link", - "Error": "Internal server error", - "Code": 500 + "link": "https://external.com/link", + "error": "Internal server error", + "code": 500 } ], "https://kilabit.info/another/page": [ { - "Link": "https://kilabit.info/another/page/image.png", - "Code": 404 + "link": "https://kilabit.info/another/page/image.png", + "code": 404 }, { - "Link": "https://external.org/link", - "Error": "Internal server error", - "Code": 500 + "link": "https://external.org/link", + "error": "Internal server error", + "code": 500 } ] } diff --git a/brokenlinks.go b/brokenlinks.go index 768216d..69a14ad 100644 --- a/brokenlinks.go +++ b/brokenlinks.go @@ -15,20 +15,20 @@ const Version = `0.1.0` // reachable during GET or HEAD, either timeout or IP or domain not exist. const StatusBadLink = 700 +// Broken store the broken link, HTTP status code, and the error message that +// cause it. +type Broken struct { + Link string `json:"link"` + Error string `json:"error,omitempty"` + Code int `json:"code"` +} + // BrokenlinksOptions define the options for scanning broken links. type BrokenlinksOptions struct { Url string IsVerbose bool } -// Broken store the broken link, HTTP status code, and the error message that -// cause it. -type Broken struct { - Link string - Error string `json:"omitempty"` - Code int -} - // BrokenlinksResult store the result of scanning for broken links. type BrokenlinksResult struct { // PageLinks store the page and its broken links. |
