diff options
| author | Shulhan <ms@kilabit.info> | 2026-01-22 01:39:41 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2026-01-22 01:39:41 +0700 |
| commit | 79eaccc81b85eb92dab9cf18d52662f367903652 (patch) | |
| tree | af58482138c2ba9211029174ab579e951cd7fff6 /brokenlinks/link_queue.go | |
| parent | 26fc8bd3203dae6b4705ada227439c90129bbe36 (diff) | |
| download | jarink-79eaccc81b85eb92dab9cf18d52662f367903652.tar.xz | |
all: refactoring, use single struct to represent Link
Previously, have [jarink.Link], [brokenlinks.Broken], and
[brokenlinks.linkQueue] to store the metadata for a link.
These changes unified them into struct [jarink.Link].
Diffstat (limited to 'brokenlinks/link_queue.go')
| -rw-r--r-- | brokenlinks/link_queue.go | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/brokenlinks/link_queue.go b/brokenlinks/link_queue.go deleted file mode 100644 index 14bf8c7..0000000 --- a/brokenlinks/link_queue.go +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-FileCopyrightText: 2025 M. Shulhan <ms@kilabit.info> -// SPDX-License-Identifier: GPL-3.0-only - -package brokenlinks - -import ( - "net/url" - - "golang.org/x/net/html/atom" -) - -type linkQueue struct { - parentUrl *url.URL - - // The error from scan. - errScan error - - // url being scanned. - url string - - // kind of url, its either an anchor or image. - // It set to 0 if url is the first URL being scanned. - kind atom.Atom - - // isExternal if true the scan will issue HTTP method HEAD instead of - // GET. - isExternal bool - - // Status of link after scan, its mostly used the HTTP status code. - // 0: link is the result of scan, not processed yet. - // StatusBadLink: link is invalid, not parseable or unreachable. - // 200 - 211: OK. - // 400 - 511: Error. - status int - - // Size of the page, derived from HTTP response ContentLength. - size int64 -} |
