-
-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Rename option - Update snapshots - Add todo
- Loading branch information
Showing
11 changed files
with
147 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,33 @@ | ||
module github.com/raviqqe/muffet/v2 | ||
|
||
go 1.12 | ||
go 1.19 | ||
|
||
require ( | ||
github.com/andybalholm/brotli v1.0.4 | ||
github.com/bradleyjkemp/cupaloy v2.3.0+incompatible | ||
github.com/jessevdk/go-flags v1.5.0 | ||
github.com/klauspost/compress v1.15.14 // indirect | ||
github.com/kr/text v0.2.0 // indirect | ||
github.com/logrusorgru/aurora/v3 v3.0.0 | ||
github.com/mattn/go-colorable v0.1.13 | ||
github.com/mattn/go-isatty v0.0.17 | ||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect | ||
github.com/oxffaa/gopher-parse-sitemap v0.0.0-20191021113419-005d2eb1def4 | ||
github.com/stretchr/testify v1.8.1 | ||
github.com/temoto/robotstxt v1.1.2 | ||
github.com/valyala/fasthttp v1.44.0 | ||
github.com/yhat/scrape v0.0.0-20161128144610-24b7890b0945 | ||
go.uber.org/ratelimit v0.2.0 | ||
golang.org/x/net v0.5.0 | ||
) | ||
|
||
require ( | ||
github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 // indirect | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/klauspost/compress v1.15.14 // indirect | ||
github.com/kr/text v0.2.0 // indirect | ||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect | ||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
github.com/valyala/bytebufferpool v1.0.0 // indirect | ||
golang.org/x/sys v0.4.0 // indirect | ||
golang.org/x/text v0.6.0 // indirect | ||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,38 @@ | ||
package main | ||
|
||
type jsonErrorPageResult struct { | ||
URL string `json:"url"` | ||
Links []*jsonErrorLinkResult `json:"links"` | ||
} | ||
|
||
type jsonErrorLinkResult struct { | ||
type jsonPageResult struct { | ||
URL string `json:"url"` | ||
Error string `json:"error"` | ||
} | ||
|
||
type jsonSuccessPageResult struct { | ||
URL string `json:"url"` | ||
Links []*jsonSuccessLinkResult `json:"links"` | ||
Links []any `json:"links"` | ||
} | ||
|
||
type jsonSuccessLinkResult struct { | ||
URL string `json:"url"` | ||
Status int `json:"status"` | ||
} | ||
|
||
func newJSONErrorPageResult(r *pageResult) *jsonErrorPageResult { | ||
ls := make([]*jsonErrorLinkResult, 0, len(r.ErrorLinkResults)) | ||
type jsonErrorLinkResult struct { | ||
URL string `json:"url"` | ||
Error string `json:"error"` | ||
} | ||
|
||
for _, r := range r.ErrorLinkResults { | ||
ls = append(ls, &jsonErrorLinkResult{r.URL, r.Error.Error()}) | ||
func newJSONPageResult(r *pageResult, verbose bool) *jsonPageResult { | ||
c := len(r.ErrorLinkResults) | ||
|
||
if verbose { | ||
c += len(r.SuccessLinkResults) | ||
} | ||
|
||
return &jsonErrorPageResult{r.URL, ls} | ||
} | ||
ls := make([]any, 0, c) | ||
|
||
func newJSONSuccessPageResult(r *pageResult) *jsonSuccessPageResult { | ||
ls := make([]*jsonSuccessLinkResult, 0, len(r.SuccessLinkResults)) | ||
if verbose { | ||
for _, r := range r.SuccessLinkResults { | ||
ls = append(ls, &jsonSuccessLinkResult{r.URL, r.StatusCode}) | ||
} | ||
} | ||
|
||
for _, r := range r.SuccessLinkResults { | ||
ls = append(ls, &jsonSuccessLinkResult{r.URL, r.StatusCode}) | ||
for _, r := range r.ErrorLinkResults { | ||
ls = append(ls, &jsonErrorLinkResult{r.URL, r.Error.Error()}) | ||
} | ||
|
||
return &jsonSuccessPageResult{r.URL, ls} | ||
return &jsonPageResult{r.URL, ls} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.