From d2aa6fdd2fa63111cd2c0ee8440434d840a42c48 Mon Sep 17 00:00:00 2001 From: Justin Hawkins Date: Sat, 3 May 2025 12:37:44 +0930 Subject: [PATCH] Merge the feature branch to introduce the bleve indexing. commit e8c2bc7e4ade56f893c8fb23eac4cdb754555389 Author: Justin Hawkins Date: Sat May 3 12:36:18 2025 +0930 Clean up menu/version commit 1993533a4613a5db7bbb2ecd6b7a2694f48acd52 Author: Justin Hawkins Date: Sat May 3 12:31:50 2025 +0930 Update README commit 044cc830dcb3d05b43ab770e8ea42959873823dd Author: Justin Hawkins Date: Sat May 3 12:22:33 2025 +0930 No longer needed commit a7c37ad7c5c12fcac1d5589271e0e66af4f086e8 Author: Justin Hawkins Date: Sat May 3 12:14:59 2025 +0930 Fixup version handling commit ade0b748e978ce1d9533a928bd6369f1714ca8a8 Author: Justin Hawkins Date: Sat May 3 11:58:15 2025 +0930 Use the correct analyser for searches commit e5a65cf5cfdd82ba7aa3d2470c12c6e82c851a3f Author: Justin Hawkins Date: Fri May 2 19:51:54 2025 +0930 Fix version in template commit 0171be0ee4d11796cfc0419a00b412f8037f4d97 Author: Justin Hawkins Date: Fri May 2 19:51:41 2025 +0930 Rescrape all links if needed on startup commit ae654998f751c3883f8b3bd76005afae38209edf Author: Justin Hawkins Date: Fri May 2 19:51:25 2025 +0930 Spelling commit bfe9bbee028e5515be5b6d406e9090c61cdbbebd Author: Justin Hawkins Date: Fri May 2 19:34:06 2025 +0930 Make goreleaser set the version commit 4436313413f52b2b29a08e510ac4496016aae8a0 Author: Justin Hawkins Date: Fri May 2 11:43:58 2025 +0930 Make release matrix sane commit 7b467ecee7a3d74ba194b723034dd16bf1c53b53 Author: Justin Hawkins Date: Fri May 2 11:40:07 2025 +0930 I hate YAML, so much. commit b578e0f044e754ca70cd4ace95fdc6dc3cdcfe07 Author: Justin Hawkins Date: Thu May 1 23:47:07 2025 +0930 Update goreleaser commit fba84f0827d35359a450fb847b03f5fa78960a1f Author: Justin Hawkins Date: Thu May 1 23:45:46 2025 +0930 Update version commit e4edb08bd19c560b6f2ea5e572d5950896ac6062 Author: Justin Hawkins Date: Thu May 1 23:42:59 2025 +0930 Deps commit 58b6692d1b397de91f3531c35c6518fb58ad285a Author: Justin Hawkins Date: Thu May 1 23:39:51 2025 +0930 Mostly done, first cut commit badbe5e92ffa415b444535eca385d87fa00afa68 Author: Justin Hawkins Date: Sun Apr 27 20:28:37 2025 +0930 Remove unused code commit 903240dd18cdcd7722705f04ff40b30661969d4d Author: Justin Hawkins Date: Sun Apr 27 20:26:19 2025 +0930 Update deps commit de90b9951a82c420be0588e6c2c2b63fe0b10eff Author: Justin Hawkins Date: Sun Apr 27 20:21:33 2025 +0930 Keep on bleving commit 9b15528510a06661237249eaf7bf64c3ce71fc3c Author: Justin Hawkins Date: Fri Apr 25 23:57:04 2025 +0930 Start of blevification --- .goreleaser.yaml | 146 ++++---- .vscode/settings.json | 4 + README.md | 25 +- cmd/linkwallet/linkwallet.go | 22 +- content/content.go | 54 --- content/content_test.go | 78 ++-- db/bookmarks.go | 164 +++++---- db/db.go | 70 +++- db/index.go | 84 +---- db/index_test.go | 114 ++++++ entity/bookmark.go | 19 +- entity/index.go | 38 -- entity/meta.go | 12 +- go.mod | 116 +++--- go.sum | 346 +++++++++++------- release_tag.pl | 15 - version/version.go | 42 ++- web/templates/_layout.html | 8 +- web/templates/info.html | 7 +- web/templates/manage.html | 2 - web/templates/manage_results.html | 22 +- .../manage_results_column_header.html | 3 - web/templates/search_results.html | 5 +- web/web.go | 71 +--- 24 files changed, 797 insertions(+), 670 deletions(-) delete mode 100755 release_tag.pl delete mode 100644 web/templates/manage_results_column_header.html diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 8fa9d6e..bc800e9 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,93 +1,77 @@ +version: 2 + before: hooks: - # clean up/install modules - go mod tidy + - go test ./... + builds: - - main: cmd/linkwallet/linkwallet.go + - main: ./cmd/linkwallet/ + ldflags: + - -s -w -X github.com/tardisx/linkwallet/version.version={{.Version}} -X github.com/tardisx/linkwallet/version.commit={{.Commit}} -X github.com/tardisx/linkwallet/version.date={{.Date}} env: - CGO_ENABLED=0 goos: - linux - windows - darwin -dockers: - - goos: linux - goarch: amd64 - image_templates: - - "tardisx/linkwallet:{{ .Tag }}" - - "tardisx/linkwallet:v{{ .Major }}" - - "tardisx/linkwallet:v{{ .Major }}.{{ .Minor }}" - - "tardisx/linkwallet" - build_flag_templates: - - "--platform=linux/amd64" -nfpms: - - - id: default - package_name: linkwallet - file_name_template: "{{ .ConventionalFileName }}" - builds: - replacements: - darwin: darwin - linux: linux - windows: windows - 386: 386 - amd64: amd64_v1 - vendor: - maintainer: Justin Hawkins - description: |- - A self-hosted bookmark database with full-text page content search. - formats: - # - apk - - deb - - rpm - dependencies: - recommends: - suggests: - conflicts: - replaces: - epoch: - prerelease: - version_metadata: - release: - section: default - priority: extra - meta: false - scripts: - preinstall: "etc/preinstall.sh" - postinstall: "etc/postinstall.sh" - preremove: "etc/preremove.sh" - postremove: "etc/postremove.sh" - contents: - - src: etc/linkwallet.service - dst: /lib/systemd/system/linkwallet.service - file_info: - mode: 0664 - #mtime: 2008-01-02T15:04:05Z - owner: root - group: root - - dst: /var/lib/linkwallet - type: dir - file_info: - mode: 0700 - owner: linkwallet - group: linkwallet + - freebsd + goarch: + - arm + - arm64 + - amd64 + goarm: + - 6 + - 7 + ignore: + - goos: darwin + goarch: arm + - goos: windows + goarch: arm + - goos: windows + goarch: arm64 + - goos: freebsd + goarch: arm + archives: - - replacements: - darwin: Darwin - linux: Linux - windows: Windows - 386: i386 - amd64: x86_64 -checksum: - name_template: 'checksums.txt' -snapshot: - name_template: "{{ incpatch .Version }}-next" + - formats: [tar.gz] + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + # use zip for windows archives + format_overrides: + - goos: windows + formats: [zip] + changelog: - sort: asc - filters: - exclude: - - '^Merge:' - - '^docs:' - - '^test:' - - '^[Bb]ump' - - '^[Cc]lean' + disable: true + +dockers: + - image_templates: + - "tardisx/linkwallet:{{ .Tag }}-amd64" + use: buildx + build_flag_templates: + - "--pull" + - "--platform=linux/amd64" + - image_templates: + - "tardisx/linkwallet:{{ .Tag }}-arm64" + use: buildx + build_flag_templates: + - "--pull" + - "--platform=linux/arm64" + goarch: arm64 + +docker_manifests: + - name_template: "tardisx/linkwallet:{{ .Tag }}" + image_templates: + - "tardisx/linkwallet:{{ .Tag }}-amd64" + - "tardisx/linkwallet:{{ .Tag }}-arm64" + - name_template: "tardisx/linkwallet:latest" + image_templates: + - "tardisx/linkwallet:{{ .Tag }}-amd64" + - "tardisx/linkwallet:{{ .Tag }}-arm64" diff --git a/.vscode/settings.json b/.vscode/settings.json index 75fef50..9a205bf 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,6 @@ { "cSpell.words": [ + "bleve", "bolthold", "colly", "htmx", @@ -9,5 +10,8 @@ "serialised", "stopword", "Upsert" + ], + "cSpell.ignoreWords": [ + "rescrape" ] } \ No newline at end of file diff --git a/README.md b/README.md index 1840201..3e87a3c 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,16 @@ A self-hosted bookmark database with full-text page content search. -Searching uses English stemming, providing matches against similar words, in both page -titles and page content. Searches are lightning fast. +linkwallet uses the [Bleve](https://blevesearch.com) indexing library, providing +excellent support for free-text queries over the content of all your bookmarked +pages. ![Search][screenshot_search] -Bookmark content is automatically re-scraped periodically. Tags can be applied (though with -the full-text search they are often not needed). Bookmarks can be easily managed, and can be -imported or exported in bulk. +linkwallet indexes the page content, and automatically re-scrapes the pages +periodically. Tags can be applied (though with the full-text search they are +often not needed). Bookmarks can be easily managed, and can be imported or +exported in bulk. ![Admin][screenshot_admin] @@ -30,14 +32,11 @@ Bookmarks can be added with two clicks via the bookmarklet. * Page content periodically refreshed automatically * Interactively search across titles and content * Rippingly fast results, as you type - * full text search ~60ms (over full text content of 600 bookmarks) + * full text search ~30ms (over full text content of 600 bookmarks) * No need to remember how you filed something, you just need a keyword or two to discover it again * Embedded database, no separate database required -* Light on resources - * ~21Mb binary - * ~40Mb memory - * ~24Mb database (600 bookmarks, full text content indexed) +* Extremely light on resources * Easily export your bookmarks to a plain text file - your data is yours # Installation @@ -57,11 +56,7 @@ To upgrade: ## Packages (deb/rpm) -* Download the .deb or .rpm from the releases -* Install using apt/dpkg/rpm - * Automatically creates a systemd service, enabled and started - * Runs as user `linkwallet` - * Database stored in `/var/lib/linkwallet` +[not yet migrated to new goreleaser - please message me if you need packages] ## Binary diff --git a/cmd/linkwallet/linkwallet.go b/cmd/linkwallet/linkwallet.go index d2028b0..39ec42c 100644 --- a/cmd/linkwallet/linkwallet.go +++ b/cmd/linkwallet/linkwallet.go @@ -6,7 +6,7 @@ import ( "time" "github.com/tardisx/linkwallet/db" - "github.com/tardisx/linkwallet/version" + v "github.com/tardisx/linkwallet/version" "github.com/tardisx/linkwallet/web" ) @@ -21,7 +21,7 @@ func main() { } dbh := db.DB{} - err := dbh.Open(dbPath) + rescrape, err := dbh.Open(dbPath) if err != nil { log.Fatal(err) } @@ -31,7 +31,7 @@ func main() { go func() { for { - version.VersionInfo.UpdateVersionInfo() + v.VersionInfo.UpdateVersionInfo() time.Sleep(time.Hour * 6) } }() @@ -47,10 +47,24 @@ func main() { } }() - log.Printf("linkwallet version %s starting", version.VersionInfo.Local.Tag) + log.Printf("linkwallet version %s starting", v.VersionInfo.Local.Version) server := web.Create(bmm, cmm) go bmm.RunQueue() go bmm.UpdateContent() + + if rescrape { + log.Printf("queueing all bookmarks for rescraping, as index was just created") + bookmarks, err := bmm.AllBookmarks() + if err != nil { + log.Printf("could not load all bookmarks: %s", err.Error()) + } else { + for _, bm := range bookmarks { + bmm.QueueScrape(&bm) + } + } + log.Printf("queued %d bookmarks for scraping", len(bookmarks)) + } + server.Start() } diff --git a/content/content.go b/content/content.go index 2c07b96..124eb3d 100644 --- a/content/content.go +++ b/content/content.go @@ -2,14 +2,11 @@ package content import ( "log" - "strings" "time" - "unicode" "github.com/tardisx/linkwallet/entity" "github.com/gocolly/colly" - snowballeng "github.com/kljensen/snowball/english" ) func FetchPageInfo(bm entity.Bookmark) entity.PageInfo { @@ -33,11 +30,8 @@ func FetchPageInfo(bm entity.Bookmark) entity.PageInfo { c.OnResponse(func(r *colly.Response) { info.StatusCode = r.StatusCode info.Size = len(r.Body) - // log.Printf("content type for %s: %s (%d)", r.Request.URL.String(), r.Headers.Get("Content-Type"), info.Size) - }) - // Before making a request print "Visiting ..." c.OnRequest(func(r *colly.Request) { // log.Println("Visiting", r.URL.String()) }) @@ -49,51 +43,3 @@ func FetchPageInfo(bm entity.Bookmark) entity.PageInfo { c.Visit(url) return info } - -func Words(bm *entity.Bookmark) []string { - words := []string{} - - words = append(words, StringToStemmedSearchWords(bm.Info.RawText)...) - words = append(words, StringToStemmedSearchWords(bm.Info.Title)...) - words = append(words, StringToStemmedSearchWords(bm.URL)...) - return words -} - -// StringToStemmedSearchWords returns a list of stemmed words with stop words -// removed. -func StringToStemmedSearchWords(s string) []string { - words := []string{} - - words = append(words, stemmerFilter(stopwordFilter(tokenize(s)))...) - return words -} - -func tokenize(text string) []string { - return strings.FieldsFunc(text, func(r rune) bool { - // Split on any character that is not a letter or a number. - return !unicode.IsLetter(r) && !unicode.IsNumber(r) - }) -} - -func stemmerFilter(tokens []string) []string { - r := make([]string, len(tokens)) - for i, token := range tokens { - r[i] = snowballeng.Stem(token, false) - } - return r -} - -var stopwords = map[string]struct{}{ // I wish Go had built-in sets. - "a": {}, "and": {}, "be": {}, "have": {}, "i": {}, - "in": {}, "of": {}, "that": {}, "the": {}, "to": {}, -} - -func stopwordFilter(tokens []string) []string { - r := make([]string, 0, len(tokens)) - for _, token := range tokens { - if _, ok := stopwords[token]; !ok { - r = append(r, token) - } - } - return r -} diff --git a/content/content_test.go b/content/content_test.go index 4ed4c13..8839c90 100644 --- a/content/content_test.go +++ b/content/content_test.go @@ -47,45 +47,45 @@ func TestSimpleScrape(t *testing.T) { } } -func TestWords(t *testing.T) { +// func TestWords(t *testing.T) { - bm := entity.Bookmark{ - // ID: 0, - // URL: "", - Info: entity.PageInfo{RawText: "the quick brown fox jumped over the lazy dog"}, - // Tags: []string{}, - } - words := Words(&bm) - if len(words) != 7 { - t.Errorf("got %d words not 7", len(words)) - } else { - if words[0] != "quick" || - words[1] != "brown" || - words[2] != "fox" || - words[3] != "jump" || - words[4] != "over" || - words[5] != "lazi" || - words[6] != "dog" { - t.Error("incorrect words returned") - } - } -} +// bm := entity.Bookmark{ +// // ID: 0, +// // URL: "", +// Info: entity.PageInfo{RawText: "the quick brown fox jumped over the lazy dog"}, +// // Tags: []string{}, +// } +// words := Words(&bm) +// if len(words) != 7 { +// t.Errorf("got %d words not 7", len(words)) +// } else { +// if words[0] != "quick" || +// words[1] != "brown" || +// words[2] != "fox" || +// words[3] != "jump" || +// words[4] != "over" || +// words[5] != "lazi" || +// words[6] != "dog" { +// t.Error("incorrect words returned") +// } +// } +// } -func TestStemmer(t *testing.T) { - s := `quick quick fox 😂 smile http://google.com` - words1 := StringToStemmedSearchWords(s) - t.Log(words1) - if len(words1) != 7 { - t.Error("wrong number of words") - } - if words1[0] != "quick" || - words1[1] != "quick" || - words1[2] != "fox" || - words1[3] != "smile" || - words1[4] != "http" || - words1[5] != "googl" || - words1[6] != "com" { - t.Error("bad words") - } +// func TestStemmer(t *testing.T) { +// s := `quick quick fox 😂 smile http://google.com` +// words1 := StringToStemmedSearchWords(s) +// t.Log(words1) +// if len(words1) != 7 { +// t.Error("wrong number of words") +// } +// if words1[0] != "quick" || +// words1[1] != "quick" || +// words1[2] != "fox" || +// words1[3] != "smile" || +// words1[4] != "http" || +// words1[5] != "googl" || +// words1[6] != "com" { +// t.Error("bad words") +// } -} +// } diff --git a/db/bookmarks.go b/db/bookmarks.go index 99dad04..19c2070 100644 --- a/db/bookmarks.go +++ b/db/bookmarks.go @@ -3,13 +3,19 @@ package db import ( "errors" "fmt" + "html/template" "io" "log" "os" + "path/filepath" + "strconv" "strings" "sync" "time" + "github.com/blevesearch/bleve/v2" + "github.com/blevesearch/bleve/v2/analysis/lang/en" + "github.com/blevesearch/bleve/v2/search/query" "github.com/tardisx/linkwallet/content" "github.com/tardisx/linkwallet/entity" @@ -22,9 +28,9 @@ type BookmarkManager struct { } type SearchOptions struct { - Query string - Tags []string - Sort string + All bool + Query string + Results int } func NewBookmarkManager(db *DB) *BookmarkManager { @@ -63,19 +69,19 @@ func (m *BookmarkManager) DeleteBookmark(bm *entity.Bookmark) error { // delete it m.db.store.DeleteMatching(bm, bolthold.Where("ID").Eq(bm.ID)) // delete all the index entries - m.db.UpdateIndexForWordsByID([]string{}, bm.ID) - return nil + return m.db.bleve.Delete(fmt.Sprint(bm.ID)) } // ListBookmarks returns all bookmarks. -func (m *BookmarkManager) ListBookmarks() ([]entity.Bookmark, error) { - bookmarks := make([]entity.Bookmark, 0) - err := m.db.store.Find(&bookmarks, &bolthold.Query{}) - if err != nil { - panic(err) - } - return bookmarks, nil -} +// func (m *BookmarkManager) ListBookmarks() ([]entity.Bookmark, error) { +// bookmarks := make([]entity.Bookmark, 0) +// err := m.db.store.Find(&bookmarks, &bolthold.Query{}) +// if err != nil { +// panic(err) +// } +// log.Printf("found %d bookmarks", len(bookmarks)) +// return bookmarks, nil +// } // ExportBookmarks exports all bookmarks to an io.Writer func (m *BookmarkManager) ExportBookmarks(w io.Writer) error { @@ -108,80 +114,53 @@ func (m *BookmarkManager) LoadBookmarkByID(id uint64) entity.Bookmark { return ret } -func (m *BookmarkManager) Search(opts SearchOptions) ([]entity.Bookmark, error) { - - // first get a list of all the ids that match our query - idsMatchingQuery := make([]uint64, 0, 0) - counts := make(map[uint64]uint8) - words := content.StringToStemmedSearchWords(opts.Query) - - for _, word := range words { - var wi *entity.WordIndex - err := m.db.store.Get("word_index_"+word, &wi) - if err == bolthold.ErrNotFound { - continue - } - if err != nil { - return nil, fmt.Errorf("error retrieving index: %w", err) - } - for k := range wi.Bitmap { - counts[k]++ - } +func (m *BookmarkManager) Search(opts SearchOptions) ([]entity.BookmarkSearchResult, error) { + found := []entity.BookmarkSearchResult{} + if opts.All && opts.Query != "" { + panic("can't fetch all with query") } - for k, v := range counts { - if v == uint8(len(words)) { - idsMatchingQuery = append(idsMatchingQuery, k) - if len(idsMatchingQuery) > 10 { - break - } - } - } + var q query.Query - // now we can do our search - bhQuery := bolthold.Query{} - if opts.Query != "" { - bhQuery = bolthold.Query(*bhQuery.And("ID").In(bolthold.Slice(idsMatchingQuery)...)) - } - if opts.Tags != nil && len(opts.Tags) > 0 { - bhQuery = bolthold.Query(*bhQuery.And("Tags").ContainsAll(bolthold.Slice(opts.Tags)...)) - } - - reverse := false - sortOrder := opts.Sort - if sortOrder != "" && sortOrder[0] == '-' { - reverse = true - sortOrder = sortOrder[1:] - } - - if sortOrder == "title" { - bhQuery.SortBy("Info.Title") - } else if sortOrder == "created" { - bhQuery.SortBy("TimestampCreated") - } else if sortOrder == "scraped" { - bhQuery.SortBy("TimestampLastScraped") + if opts.All { + q = bleve.NewMatchAllQuery() } else { - bhQuery.SortBy("ID") + mq := bleve.NewMatchQuery(opts.Query) + mq.Analyzer = en.AnalyzerName + tq := bleve.NewTermQuery(opts.Query) + + q = bleve.NewDisjunctionQuery(mq, tq) } - if reverse { - bhQuery = *bhQuery.Reverse() + req := bleve.NewSearchRequest(q) + if opts.Results > 0 { + req.Size = opts.Results } + req.Highlight = bleve.NewHighlightWithStyle("html") - out := []entity.Bookmark{} - err := m.db.store.ForEach(&bhQuery, - func(bm *entity.Bookmark) error { - out = append(out, *bm) - - return nil - }) + sr, err := m.db.bleve.Search(req) if err != nil { panic(err) } + // log.Printf("%#v", m.db.bleve.StatsMap()) + + if sr.Total > 0 { + for _, dm := range sr.Hits { + + id, _ := strconv.ParseUint(dm.ID, 10, 64) + bm := m.LoadBookmarkByID(id) + bsr := entity.BookmarkSearchResult{ + Bookmark: bm, + Score: dm.Score, + Highlight: template.HTML(strings.Join(dm.Fragments["Info.RawText"], "\n")), + } + found = append(found, bsr) + } + } m.db.IncrementSearches() - return out, nil + return found, nil } func (m *BookmarkManager) ScrapeAndIndex(bm *entity.Bookmark) error { @@ -205,9 +184,11 @@ func (m *BookmarkManager) ScrapeAndIndex(bm *entity.Bookmark) error { } func (m *BookmarkManager) UpdateIndexForBookmark(bm *entity.Bookmark) { - words := content.Words(bm) - words = append(words, bm.Tags...) - m.db.UpdateIndexForWordsByID(words, bm.ID) + log.Printf("inserting into bleve data for %s", bm.URL) + err := m.db.bleve.Index(fmt.Sprint(bm.ID), bm) + if err != nil { + panic(err) + } } func (m *BookmarkManager) QueueScrape(bm *entity.Bookmark) { @@ -281,6 +262,17 @@ func (m *BookmarkManager) UpdateContent() { } } +// AllBookmarks returns all bookmarks. It does not use the index for this +// operation. +func (m *BookmarkManager) AllBookmarks() ([]entity.Bookmark, error) { + bookmarks := make([]entity.Bookmark, 0) + err := m.db.store.Find(&bookmarks, &bolthold.Query{}) + if err != nil { + panic(err) + } + return bookmarks, nil +} + func (m *BookmarkManager) Stats() (entity.DBStats, error) { stats := entity.DBStats{} err := m.db.store.Get("stats", &stats) @@ -293,5 +285,25 @@ func (m *BookmarkManager) Stats() (entity.DBStats, error) { return stats, fmt.Errorf("could not load db file size: %s", err) } stats.FileSize = int(fi.Size()) + indexSize, err := getBleveIndexSize(m.db.file + ".bleve") + if err != nil { + return entity.DBStats{}, err + } + stats.IndexSize = int(indexSize) + return stats, nil } + +func getBleveIndexSize(path string) (int64, error) { + var size int64 + err := filepath.Walk(path, func(_ string, info os.FileInfo, err error) error { + if err != nil { + return err + } + if !info.IsDir() { + size += info.Size() + } + return nil + }) + return size, err +} diff --git a/db/db.go b/db/db.go index 1e74da4..8cb0ec8 100644 --- a/db/db.go +++ b/db/db.go @@ -4,6 +4,11 @@ import ( "fmt" "time" + "github.com/blevesearch/bleve/v2" + + "github.com/blevesearch/bleve/v2/analysis/analyzer/keyword" + "github.com/blevesearch/bleve/v2/analysis/lang/en" + "github.com/blevesearch/bleve/v2/mapping" "github.com/tardisx/linkwallet/entity" bolthold "github.com/timshannon/bolthold" ) @@ -11,19 +16,70 @@ import ( type DB struct { store *bolthold.Store file string + bleve bleve.Index } -func (db *DB) Open(path string) error { +// Open opens the bookmark boltdb, and the bleve index. It returns +// true if the index was newly created, so the caller knows all bookmarks +// need to be re-scraped +func (db *DB) Open(path string) (bool, error) { // options := bolthold.DefaultOptions // options.Dir = dir // options.ValueDir = dir + rescrapeNeeded := false store, err := bolthold.Open(path, 0666, nil) if err != nil { - return fmt.Errorf("cannot open '%s' - %s", path, err) + return false, fmt.Errorf("cannot open '%s' - %s", path, err) } + + blevePath := path + ".bleve" + + index, err := bleve.New(blevePath, createIndexMapping()) + + if err != nil { + if err == bleve.ErrorIndexPathExists { + index, err = bleve.Open(blevePath) + if err != nil { + return false, fmt.Errorf("cannot open bleve '%s' - %s", path, err) + } + } else { + return false, fmt.Errorf("cannot open bleve '%s' - %s", path, err) + } + } else { + // we just created an index, one didn't exist, so we need to queue + // all bookmarks to be scraped + rescrapeNeeded = true + } + db.store = store db.file = path - return nil + db.bleve = index + return rescrapeNeeded, nil +} + +func createIndexMapping() mapping.IndexMapping { + indexMapping := bleve.NewIndexMapping() + + englishTextFieldMapping := bleve.NewTextFieldMapping() + englishTextFieldMapping.Analyzer = en.AnalyzerName + + // a generic reusable mapping for keyword text + keywordFieldMapping := bleve.NewTextFieldMapping() + keywordFieldMapping.Analyzer = keyword.Name + + pageInfoMapping := bleve.NewDocumentMapping() + pageInfoMapping.AddFieldMappingsAt("Title", englishTextFieldMapping) + pageInfoMapping.AddFieldMappingsAt("Size", bleve.NewNumericFieldMapping()) + pageInfoMapping.AddFieldMappingsAt("RawText", englishTextFieldMapping) + + bookmarkMapping := bleve.NewDocumentMapping() + bookmarkMapping.AddFieldMappingsAt("URL", bleve.NewTextFieldMapping()) + bookmarkMapping.AddFieldMappingsAt("Tags", keywordFieldMapping) + bookmarkMapping.AddSubDocumentMapping("Info", pageInfoMapping) + + indexMapping.AddDocumentMapping("bookmark", bookmarkMapping) + + return indexMapping } func (db *DB) Close() { @@ -73,17 +129,11 @@ func (db *DB) UpdateBookmarkStats() error { } // count bookmarks and words indexed bmI := entity.Bookmark{} - wiI := entity.WordIndex{} bookmarkCount, err := db.store.TxCount(txn, &bmI, &bolthold.Query{}) if err != nil { txn.Rollback() return fmt.Errorf("could not get bookmark count: %s", err) } - indexWordCount, err := db.store.TxCount(txn, &wiI, &bolthold.Query{}) - if err != nil { - txn.Rollback() - return fmt.Errorf("could not get index word count: %s", err) - } // bucket these stats by day now := time.Now().Truncate(time.Hour * 24) @@ -97,7 +147,7 @@ func (db *DB) UpdateBookmarkStats() error { if stats.History == nil { stats.History = make(map[time.Time]entity.BookmarkInfo) } - stats.History[now] = entity.BookmarkInfo{Bookmarks: bookmarkCount, IndexedWords: indexWordCount} + stats.History[now] = entity.BookmarkInfo{Bookmarks: bookmarkCount} err = db.store.TxUpsert(txn, "stats", &stats) if err != nil { txn.Rollback() diff --git a/db/index.go b/db/index.go index 7b85270..eefcc02 100644 --- a/db/index.go +++ b/db/index.go @@ -1,80 +1,24 @@ package db -import ( - "log" - - "github.com/tardisx/linkwallet/entity" - bolthold "github.com/timshannon/bolthold" -) - func (db *DB) InitIndices() { - wi := entity.WordIndex{} - db.store.DeleteMatching(wi, &bolthold.Query{}) + panic("unimplemented") + // wi := entity.WordIndex{} + // db.store.DeleteMatching(wi, &bolthold.Query{}) } -func (db *DB) UpdateIndexForWordsByID(words []string, id uint64) { - // delete this id from all indices - txn, err := db.store.Bolt().Begin(true) - if err != nil { - panic(err) - } - db.store.TxForEach(txn, &bolthold.Query{}, func(wi *entity.WordIndex) error { - delete(wi.Bitmap, id) - // if the index is now completely empty, nuke it entirely - empty := true - for _, v := range wi.Bitmap { - if v { - empty = false - break - } - } +// func (db *DB) IndexDocument(id uint64, info entity.PageInfo) { +// log.Printf("I am indexing!") +// err := db.bleve.Index(fmt.Sprint(id), info) +// if err != nil { +// panic(err) +// } +// } - if empty { - db.store.TxDelete(txn, "word_index_"+wi.Word, wi) - } else { - db.store.TxUpdate(txn, "word_index_"+wi.Word, wi) - } - return nil - }) - - // adding - for i, word := range words { - // log.Printf("indexing %s", word) - thisWI := entity.WordIndex{Word: word} - err := db.store.TxGet(txn, "word_index_"+word, &thisWI) - if err == bolthold.ErrNotFound { - // create it - thisWI.Bitmap = map[uint64]bool{} - } else if err != nil { - panic(err) - } - - thisWI.Bitmap[id] = true - err = db.store.TxUpsert(txn, "word_index_"+word, thisWI) - if err != nil { - panic(err) - } - - if i > 0 && i%100 == 0 { - txn.Commit() - txn, err = db.store.Bolt().Begin(true) - if err != nil { - panic(err) - } - } - } - - txn.Commit() -} +// func (db *DB) UpdateIndexForWordsByID(words []string, id uint64) { +// panic("I should not be called") +// } func (db *DB) DumpIndex() { - - err := db.store.ForEach(&bolthold.Query{}, func(wi *entity.WordIndex) error { - log.Printf("%10s: %v", wi.Word, wi.Bitmap) - return nil - }) - if err != nil { - panic(err) - } + panic("unimplemented") } diff --git a/db/index_test.go b/db/index_test.go index 8bf640e..e88dbba 100644 --- a/db/index_test.go +++ b/db/index_test.go @@ -5,6 +5,10 @@ import ( "net/http/httptest" "os" "testing" + "time" + + "github.com/blevesearch/bleve/v2" + "github.com/blevesearch/bleve/v2/search/query" "github.com/tardisx/linkwallet/entity" ) @@ -141,3 +145,113 @@ func TestTagIndexing(t *testing.T) { t.Error("did not get one id for sloth") } } + +func testBM() entity.Bookmark { + return entity.Bookmark{ + ID: 1, + URL: "https://one.com", + Info: entity.PageInfo{ + Fetched: time.Time{}, + Title: "one web", + Size: 200, + StatusCode: 200, + RawText: "one web site is great for all humans", + }, + Tags: []string{"hello", "big friends"}, + PreserveTitle: false, + TimestampCreated: time.Time{}, + TimestampLastScraped: time.Time{}, + } +} + +func TestMappings(t *testing.T) { + mapping := createIndexMapping() + idx, err := bleve.NewMemOnly(mapping) + if err != nil { + t.Error(err) + t.FailNow() + } + + bm := testBM() + err = idx.Index("1", bm) + if err != nil { + panic(err) + } + + type tc struct { + query query.Query + expHits int + } + tcs := []tc{ + {query: bleve.NewMatchQuery("human"), expHits: 1}, + {query: bleve.NewMatchQuery("humanoid"), expHits: 0}, + {query: bleve.NewMatchQuery("hello"), expHits: 1}, + {query: bleve.NewMatchQuery("big"), expHits: 0}, + {query: bleve.NewMatchQuery("friends"), expHits: 0}, + {query: bleve.NewMatchQuery("big friend"), expHits: 0}, + {query: bleve.NewTermQuery("big friends"), expHits: 1}, + {query: bleve.NewMatchQuery("web great"), expHits: 1}, + } + + for i := range tcs { + q := tcs[i].query + + sr, err := idx.Search(bleve.NewSearchRequest(q)) + if err != nil { + t.Error(err) + } else { + if len(sr.Hits) != tcs[i].expHits { + t.Errorf("wrong hits - expected %d got %d for %s", tcs[i].expHits, len(sr.Hits), tcs[i].query) + } + } + } + +} + +func TestMappingsDisjunctionQuery(t *testing.T) { + mapping := createIndexMapping() + idx, err := bleve.NewMemOnly(mapping) + if err != nil { + t.Error(err) + t.FailNow() + } + + bm := testBM() + err = idx.Index("1", bm) + if err != nil { + panic(err) + } + + type tc struct { + query string + expHits int + } + tcs := []tc{ + {query: "human", expHits: 1}, + {query: "humanoid", expHits: 0}, + {query: "hello", expHits: 1}, + {query: "big", expHits: 0}, + {query: "friends", expHits: 0}, + {query: "big friend", expHits: 0}, + {query: "big friends", expHits: 1}, + {query: "web great", expHits: 1}, + } + + for i := range tcs { + q := tcs[i].query + req := bleve.NewDisjunctionQuery( + bleve.NewMatchQuery(q), + bleve.NewTermQuery(q), + ) + + sr, err := idx.Search(bleve.NewSearchRequest(req)) + if err != nil { + t.Error(err) + } else { + if len(sr.Hits) != tcs[i].expHits { + t.Errorf("wrong hits - expected %d got %d for %s", tcs[i].expHits, len(sr.Hits), tcs[i].query) + } + } + } + +} diff --git a/entity/bookmark.go b/entity/bookmark.go index d859b5c..ad05adf 100644 --- a/entity/bookmark.go +++ b/entity/bookmark.go @@ -1,6 +1,9 @@ package entity -import "time" +import ( + "html/template" + "time" +) type Bookmark struct { ID uint64 `boltholdKey:"ID"` @@ -12,6 +15,10 @@ type Bookmark struct { TimestampLastScraped time.Time } +func (bm Bookmark) Type() string { + return "bookmark" +} + type PageInfo struct { Fetched time.Time Title string @@ -19,3 +26,13 @@ type PageInfo struct { StatusCode int RawText string } + +func (pi PageInfo) Type() string { + return "info" +} + +type BookmarkSearchResult struct { + Bookmark Bookmark + Score float64 + Highlight template.HTML +} diff --git a/entity/index.go b/entity/index.go index 34eb474..9356433 100644 --- a/entity/index.go +++ b/entity/index.go @@ -1,39 +1 @@ package entity - -type WordIndex struct { - Word string `bolthold:"index"` - // Bitmap roaring.Bitmap - Bitmap map[uint64]bool -} - -// func (wi WordIndex) GobEncode() ([]byte, error) { - -// bmBuf := new(bytes.Buffer) -// wi.Bitmap.WriteTo(bmBuf) // we omit error handling - -// wordBytes := []byte(wi.Word) -// serialised := make([]byte, 4, 4) -// binary.BigEndian.PutUint32(serialised, uint32(len(wordBytes))) - -// serialised = append(serialised, wordBytes...) -// serialised = append(serialised, bmBuf.Bytes()...) -// // log.Printf("serialised: %v", serialised) - -// // log.Printf("serialised to %d bytes for word %w\n%#v", len(serialised), wi.Word, serialised) - -// return serialised, nil -// } - -// func (wi *WordIndex) GobDecode(b []byte) error { -// size := binary.BigEndian.Uint32(b[0:4]) -// wi.Word = string(b[4 : size+4]) -// // log.Printf("word is %s size was %d\n%v", wi.Word, size, b) - -// bmBuf := bytes.NewReader(b[size+4:]) - -// wi.Bitmap = *roaring.New() -// _, err := wi.Bitmap.ReadFrom(bmBuf) -// // log.Printf("N: %d, err: %s", n, err) - -// return err -// } diff --git a/entity/meta.go b/entity/meta.go index fab6e1b..ceee807 100644 --- a/entity/meta.go +++ b/entity/meta.go @@ -7,14 +7,14 @@ import ( ) type DBStats struct { - History map[time.Time]BookmarkInfo - FileSize int - Searches int + History map[time.Time]BookmarkInfo + FileSize int + IndexSize int + Searches int } type BookmarkInfo struct { - Bookmarks int - IndexedWords int + Bookmarks int } func (stats DBStats) String() string { @@ -29,7 +29,7 @@ func (stats DBStats) String() string { sort.Slice(dates, func(i, j int) bool { return dates[i].Before(dates[j]) }) for _, k := range dates { - out += fmt.Sprintf("%s - %d bookmarks, %d words indexed\n", k, stats.History[k].Bookmarks, stats.History[k].IndexedWords) + out += fmt.Sprintf("%s - %d bookmarks\n", k, stats.History[k].Bookmarks) } return out } diff --git a/go.mod b/go.mod index 30f4bb3..d50a702 100644 --- a/go.mod +++ b/go.mod @@ -1,61 +1,95 @@ module github.com/tardisx/linkwallet -go 1.18 +go 1.23.0 + +toolchain go1.24.1 require ( - github.com/gin-gonic/gin v1.7.7 + github.com/gin-gonic/gin v1.10.0 github.com/gocolly/colly v1.2.0 - github.com/kljensen/snowball v0.6.0 - gonum.org/v1/plot v0.12.0 + gonum.org/v1/plot v0.16.0 ) require ( - git.sr.ht/~sbinet/gg v0.3.1 // indirect + codeberg.org/go-fonts/liberation v0.5.0 // indirect + codeberg.org/go-latex/latex v0.1.0 // indirect + codeberg.org/go-pdf/fpdf v0.11.1 // indirect + git.sr.ht/~sbinet/gg v0.6.0 // indirect + github.com/RoaringBitmap/roaring/v2 v2.4.5 // indirect github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b // indirect - github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-fonts/liberation v0.2.0 // indirect - github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81 // indirect - github.com/go-pdf/fpdf v0.6.0 // indirect - github.com/go-playground/locales v0.13.0 // indirect - github.com/go-playground/universal-translator v0.17.0 // indirect - github.com/go-playground/validator/v10 v10.4.1 // indirect + github.com/bits-and-blooms/bitset v1.22.0 // indirect + github.com/blevesearch/bleve_index_api v1.2.8 // indirect + github.com/blevesearch/geo v0.2.0 // indirect + github.com/blevesearch/go-faiss v1.0.25 // indirect + github.com/blevesearch/go-porterstemmer v1.0.3 // indirect + github.com/blevesearch/gtreap v0.1.1 // indirect + github.com/blevesearch/mmap-go v1.0.4 // indirect + github.com/blevesearch/scorch_segment_api/v2 v2.3.10 // indirect + github.com/blevesearch/segment v0.9.1 // indirect + github.com/blevesearch/snowballstem v0.9.0 // indirect + github.com/blevesearch/upsidedown_store_api v1.0.2 // indirect + github.com/blevesearch/vellum v1.1.0 // indirect + github.com/blevesearch/zapx/v11 v11.4.1 // indirect + github.com/blevesearch/zapx/v12 v12.4.1 // indirect + github.com/blevesearch/zapx/v13 v13.4.1 // indirect + github.com/blevesearch/zapx/v14 v14.4.1 // indirect + github.com/blevesearch/zapx/v15 v15.4.1 // indirect + github.com/blevesearch/zapx/v16 v16.2.3 // indirect + github.com/bytedance/sonic v1.13.2 // indirect + github.com/bytedance/sonic/loader v0.2.4 // indirect + github.com/campoy/embedmd v1.0.0 // indirect + github.com/cloudwego/base64x v0.1.5 // indirect + github.com/gabriel-vasile/mimetype v1.4.9 // indirect + github.com/gin-contrib/sse v1.1.0 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.26.0 // indirect + github.com/goccy/go-json v0.10.5 // indirect github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect + github.com/golang/snappy v1.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect - github.com/json-iterator/go v1.1.9 // indirect - github.com/kr/pretty v0.1.0 // indirect - github.com/leodido/go-urn v1.2.0 // indirect - github.com/mattn/go-isatty v0.0.12 // indirect - github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect - github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 // indirect - github.com/ugorji/go/codec v1.1.7 // indirect - go.etcd.io/bbolt v1.3.6 // indirect - golang.org/x/crypto v0.7.0 // indirect - golang.org/x/image v0.6.0 // indirect - gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect - gopkg.in/yaml.v2 v2.2.8 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/cpuid/v2 v2.2.10 // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/leodido/go-urn v1.4.0 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/mschoch/smat v0.2.0 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/ugorji/go/codec v1.2.12 // indirect + go.etcd.io/bbolt v1.4.0 // indirect + golang.org/x/arch v0.16.0 // indirect + golang.org/x/crypto v0.37.0 // indirect + golang.org/x/image v0.26.0 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) require ( - github.com/PuerkitoBio/goquery v1.8.0 // indirect - github.com/andybalholm/cascadia v1.3.1 // indirect - github.com/antchfx/htmlquery v1.2.4 // indirect - github.com/antchfx/xmlquery v1.3.10 // indirect - github.com/antchfx/xpath v1.2.0 // indirect - github.com/gin-contrib/gzip v0.0.5 + github.com/PuerkitoBio/goquery v1.10.3 // indirect + github.com/andybalholm/cascadia v1.3.3 // indirect + github.com/antchfx/htmlquery v1.3.4 // indirect + github.com/antchfx/xmlquery v1.4.4 // indirect + github.com/antchfx/xpath v1.3.4 // indirect + github.com/blevesearch/bleve/v2 v2.5.0 + github.com/gin-contrib/gzip v1.2.3 github.com/gobwas/glob v0.2.3 // indirect - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.2 // indirect - github.com/gomarkdown/markdown v0.0.0-20220627144906-e9a81102ebeb + github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/gomarkdown/markdown v0.0.0-20250311123330-531bef5e742b github.com/google/go-github/v44 v44.1.0 github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b github.com/kennygrant/sanitize v1.2.4 // indirect - github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca // indirect + github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d // indirect github.com/temoto/robotstxt v1.1.2 // indirect - github.com/timshannon/bolthold v0.0.0-20210913165410-232392fc8a6a - golang.org/x/mod v0.8.0 - golang.org/x/net v0.8.0 // indirect - golang.org/x/sys v0.6.0 // indirect - golang.org/x/text v0.8.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.27.1 // indirect + github.com/timshannon/bolthold v0.0.0-20240314194003-30aac6950928 + golang.org/x/mod v0.24.0 + golang.org/x/net v0.39.0 // indirect + golang.org/x/sys v0.32.0 // indirect + golang.org/x/text v0.24.0 // indirect + google.golang.org/appengine v1.6.8 // indirect + google.golang.org/protobuf v1.36.6 // indirect ) diff --git a/go.sum b/go.sum index 9858f80..4727155 100644 --- a/go.sum +++ b/go.sum @@ -1,215 +1,311 @@ -git.sr.ht/~sbinet/gg v0.3.1 h1:LNhjNn8DerC8f9DHLz6lS0YYul/b602DUxDgGkd/Aik= -git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= +codeberg.org/go-fonts/dejavu v0.4.0 h1:2yn58Vkh4CFK3ipacWUAIE3XVBGNa0y1bc95Bmfx91I= +codeberg.org/go-fonts/dejavu v0.4.0/go.mod h1:abni088lmhQJvso2Lsb7azCKzwkfcnttl6tL1UTWKzg= +codeberg.org/go-fonts/latin-modern v0.4.0 h1:vkRCc1y3whKA7iL9Ep0fSGVuJfqjix0ica9UflHORO8= +codeberg.org/go-fonts/latin-modern v0.4.0/go.mod h1:BF68mZznJ9QHn+hic9ks2DaFl4sR5YhfM6xTYaP9vNw= +codeberg.org/go-fonts/liberation v0.5.0 h1:SsKoMO1v1OZmzkG2DY+7ZkCL9U+rrWI09niOLfQ5Bo0= +codeberg.org/go-fonts/liberation v0.5.0/go.mod h1:zS/2e1354/mJ4pGzIIaEtm/59VFCFnYC7YV6YdGl5GU= +codeberg.org/go-latex/latex v0.1.0 h1:hoGO86rIbWVyjtlDLzCqZPjNykpWQ9YuTZqAzPcfL3c= +codeberg.org/go-latex/latex v0.1.0/go.mod h1:LA0q/AyWIYrqVd+A9Upkgsb+IqPcmSTKc9Dny04MHMw= +codeberg.org/go-pdf/fpdf v0.11.1 h1:U8+coOTDVLxHIXZgGvkfQEi/q0hYHYvEHFuGNX2GzGs= +codeberg.org/go-pdf/fpdf v0.11.1/go.mod h1:Y0DGRAdZ0OmnZPvjbMp/1bYxmIPxm0ws4tfoPOc4LjU= +git.sr.ht/~sbinet/cmpimg v0.1.0 h1:E0zPRk2muWuCqSKSVZIWsgtU9pjsw3eKHi8VmQeScxo= +git.sr.ht/~sbinet/cmpimg v0.1.0/go.mod h1:FU12psLbF4TfNXkKH2ZZQ29crIqoiqTZmeQ7dkp/pxE= +git.sr.ht/~sbinet/gg v0.6.0 h1:RIzgkizAk+9r7uPzf/VfbJHBMKUr0F5hRFxTUGMnt38= +git.sr.ht/~sbinet/gg v0.6.0/go.mod h1:uucygbfC9wVPQIfrmwM2et0imr8L7KQWywX0xpFMm94= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/PuerkitoBio/goquery v1.8.0 h1:PJTF7AmFCFKk1N6V6jmKfrNH9tV5pNE6lZMkG0gta/U= -github.com/PuerkitoBio/goquery v1.8.0/go.mod h1:ypIiRMtY7COPGk+I/YbZLbxsxn9g5ejnI2HSMtkjZvI= +github.com/PuerkitoBio/goquery v1.10.3 h1:pFYcNSqHxBD06Fpj/KsbStFRsgRATgnf3LeXiUkhzPo= +github.com/PuerkitoBio/goquery v1.10.3/go.mod h1:tMUX0zDMHXYlAQk6p35XxQMqMweEKB7iK7iLNd4RH4Y= +github.com/RoaringBitmap/roaring/v2 v2.4.5 h1:uGrrMreGjvAtTBobc0g5IrW1D5ldxDQYe2JW2gggRdg= +github.com/RoaringBitmap/roaring/v2 v2.4.5/go.mod h1:FiJcsfkGje/nZBZgCu0ZxCPOKD/hVXDS2dXi7/eUFE0= github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm/4RlzPXRlREEwqTHAN3T56Bv2ITsFT3gY= github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk= github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b h1:slYM766cy2nI3BwyRiyQj/Ud48djTMtMebDqepE95rw= github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM= -github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= -github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA= -github.com/antchfx/htmlquery v1.2.4 h1:qLteofCMe/KGovBI6SQgmou2QNyedFUW+pE+BpeZ494= -github.com/antchfx/htmlquery v1.2.4/go.mod h1:2xO6iu3EVWs7R2JYqBbp8YzG50gj/ofqs5/0VZoDZLc= -github.com/antchfx/xmlquery v1.3.10 h1:U2yMwr8U0KmGM2iDG2Ky/3LfxNsiK4uw1bSBkeMO9+g= -github.com/antchfx/xmlquery v1.3.10/go.mod h1:wojC/BxjEkjJt6dPiAqUzoXO5nIMWtxHS8PD8TmN4ks= -github.com/antchfx/xpath v1.2.0 h1:mbwv7co+x0RwgeGAOHdrKy89GvHaGvxxBtPK0uF9Zr8= -github.com/antchfx/xpath v1.2.0/go.mod h1:i54GszH55fYfBmoZXapTHN8T8tkcHfRgLyVwwqzXNcs= -github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= -github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/andybalholm/cascadia v1.3.3 h1:AG2YHrzJIm4BZ19iwJ/DAua6Btl3IwJX+VI4kktS1LM= +github.com/andybalholm/cascadia v1.3.3/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmgu1YHNnWw0GeA= +github.com/antchfx/htmlquery v1.3.4 h1:Isd0srPkni2iNTWCwVj/72t7uCphFeor5Q8nCzj1jdQ= +github.com/antchfx/htmlquery v1.3.4/go.mod h1:K9os0BwIEmLAvTqaNSua8tXLWRWZpocZIH73OzWQbwM= +github.com/antchfx/xmlquery v1.4.4 h1:mxMEkdYP3pjKSftxss4nUHfjBhnMk4imGoR96FRY2dg= +github.com/antchfx/xmlquery v1.4.4/go.mod h1:AEPEEPYE9GnA2mj5Ur2L5Q5/2PycJ0N9Fusrx9b12fc= +github.com/antchfx/xpath v1.3.3/go.mod h1:i54GszH55fYfBmoZXapTHN8T8tkcHfRgLyVwwqzXNcs= +github.com/antchfx/xpath v1.3.4 h1:1ixrW1VnXd4HurCj7qnqnR0jo14g8JMe20Fshg1Vgz4= +github.com/antchfx/xpath v1.3.4/go.mod h1:i54GszH55fYfBmoZXapTHN8T8tkcHfRgLyVwwqzXNcs= +github.com/bits-and-blooms/bitset v1.12.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/bits-and-blooms/bitset v1.22.0 h1:Tquv9S8+SGaS3EhyA+up3FXzmkhxPGjQQCkcs2uw7w4= +github.com/bits-and-blooms/bitset v1.22.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/blevesearch/bleve/v2 v2.5.0 h1:HzYqBy/5/M9Ul9ESEmXzN/3Jl7YpmWBdHM/+zzv/3k4= +github.com/blevesearch/bleve/v2 v2.5.0/go.mod h1:PcJzTPnEynO15dCf9isxOga7YFRa/cMSsbnRwnszXUk= +github.com/blevesearch/bleve_index_api v1.2.8 h1:Y98Pu5/MdlkRyLM0qDHostYo7i+Vv1cDNhqTeR4Sy6Y= +github.com/blevesearch/bleve_index_api v1.2.8/go.mod h1:rKQDl4u51uwafZxFrPD1R7xFOwKnzZW7s/LSeK4lgo0= +github.com/blevesearch/geo v0.2.0 h1:f+IE3/C3mGeXDyhtMbWel6BgqBqaOUz43GtWg26GlB0= +github.com/blevesearch/geo v0.2.0/go.mod h1:k8Hyfz12kM8QmeWLhgX7VMMCoVFmttBnr62V5zniXak= +github.com/blevesearch/go-faiss v1.0.25 h1:lel1rkOUGbT1CJ0YgzKwC7k+XH0XVBHnCVWahdCXk4U= +github.com/blevesearch/go-faiss v1.0.25/go.mod h1:OMGQwOaRRYxrmeNdMrXJPvVx8gBnvE5RYrr0BahNnkk= +github.com/blevesearch/go-porterstemmer v1.0.3 h1:GtmsqID0aZdCSNiY8SkuPJ12pD4jI+DdXTAn4YRcHCo= +github.com/blevesearch/go-porterstemmer v1.0.3/go.mod h1:angGc5Ht+k2xhJdZi511LtmxuEf0OVpvUUNrwmM1P7M= +github.com/blevesearch/gtreap v0.1.1 h1:2JWigFrzDMR+42WGIN/V2p0cUvn4UP3C4Q5nmaZGW8Y= +github.com/blevesearch/gtreap v0.1.1/go.mod h1:QaQyDRAT51sotthUWAH4Sj08awFSSWzgYICSZ3w0tYk= +github.com/blevesearch/mmap-go v1.0.4 h1:OVhDhT5B/M1HNPpYPBKIEJaD0F3Si+CrEKULGCDPWmc= +github.com/blevesearch/mmap-go v1.0.4/go.mod h1:EWmEAOmdAS9z/pi/+Toxu99DnsbhG1TIxUoRmJw/pSs= +github.com/blevesearch/scorch_segment_api/v2 v2.3.10 h1:Yqk0XD1mE0fDZAJXTjawJ8If/85JxnLd8v5vG/jWE/s= +github.com/blevesearch/scorch_segment_api/v2 v2.3.10/go.mod h1:Z3e6ChN3qyN35yaQpl00MfI5s8AxUJbpTR/DL8QOQ+8= +github.com/blevesearch/segment v0.9.1 h1:+dThDy+Lvgj5JMxhmOVlgFfkUtZV2kw49xax4+jTfSU= +github.com/blevesearch/segment v0.9.1/go.mod h1:zN21iLm7+GnBHWTao9I+Au/7MBiL8pPFtJBJTsk6kQw= +github.com/blevesearch/snowballstem v0.9.0 h1:lMQ189YspGP6sXvZQ4WZ+MLawfV8wOmPoD/iWeNXm8s= +github.com/blevesearch/snowballstem v0.9.0/go.mod h1:PivSj3JMc8WuaFkTSRDW2SlrulNWPl4ABg1tC/hlgLs= +github.com/blevesearch/upsidedown_store_api v1.0.2 h1:U53Q6YoWEARVLd1OYNc9kvhBMGZzVrdmaozG2MfoB+A= +github.com/blevesearch/upsidedown_store_api v1.0.2/go.mod h1:M01mh3Gpfy56Ps/UXHjEO/knbqyQ1Oamg8If49gRwrQ= +github.com/blevesearch/vellum v1.1.0 h1:CinkGyIsgVlYf8Y2LUQHvdelgXr6PYuvoDIajq6yR9w= +github.com/blevesearch/vellum v1.1.0/go.mod h1:QgwWryE8ThtNPxtgWJof5ndPfx0/YMBh+W2weHKPw8Y= +github.com/blevesearch/zapx/v11 v11.4.1 h1:qFCPlFbsEdwbbckJkysptSQOsHn4s6ZOHL5GMAIAVHA= +github.com/blevesearch/zapx/v11 v11.4.1/go.mod h1:qNOGxIqdPC1MXauJCD9HBG487PxviTUUbmChFOAosGs= +github.com/blevesearch/zapx/v12 v12.4.1 h1:K77bhypII60a4v8mwvav7r4IxWA8qxhNjgF9xGdb9eQ= +github.com/blevesearch/zapx/v12 v12.4.1/go.mod h1:QRPrlPOzAxBNMI0MkgdD+xsTqx65zbuPr3Ko4Re49II= +github.com/blevesearch/zapx/v13 v13.4.1 h1:EnkEMZFUK0lsW/jOJJF2xOcp+W8TjEsyeN5BeAZEYYE= +github.com/blevesearch/zapx/v13 v13.4.1/go.mod h1:e6duBMlCvgbH9rkzNMnUa9hRI9F7ri2BRcHfphcmGn8= +github.com/blevesearch/zapx/v14 v14.4.1 h1:G47kGCshknBZzZAtjcnIAMn3oNx8XBLxp8DMq18ogyE= +github.com/blevesearch/zapx/v14 v14.4.1/go.mod h1:O7sDxiaL2r2PnCXbhh1Bvm7b4sP+jp4unE9DDPWGoms= +github.com/blevesearch/zapx/v15 v15.4.1 h1:B5IoTMUCEzFdc9FSQbhVOxAY+BO17c05866fNruiI7g= +github.com/blevesearch/zapx/v15 v15.4.1/go.mod h1:b/MreHjYeQoLjyY2+UaM0hGZZUajEbE0xhnr1A2/Q6Y= +github.com/blevesearch/zapx/v16 v16.2.3 h1:7Y0r+a3diEvlazsncexq1qoFOcBd64xwMS7aDm4lo1s= +github.com/blevesearch/zapx/v16 v16.2.3/go.mod h1:wVJ+GtURAaRG9KQAMNYyklq0egV+XJlGcXNCE0OFjjA= +github.com/bytedance/sonic v1.13.2 h1:8/H1FempDZqC4VqjptGo14QQlJx8VdZJegxs6wwfqpQ= +github.com/bytedance/sonic v1.13.2/go.mod h1:o68xyaF9u2gvVBuGHPlUVCy+ZfmNNO5ETf1+KgkJhz4= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/bytedance/sonic/loader v0.2.4 h1:ZWCw4stuXUsn1/+zQDqeE7JKP+QO47tz7QCNan80NzY= +github.com/bytedance/sonic/loader v0.2.4/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI= +github.com/campoy/embedmd v1.0.0 h1:V4kI2qTJJLf4J29RzI/MAt2c3Bl4dQSYPuflzwFH2hY= +github.com/campoy/embedmd v1.0.0/go.mod h1:oxyr9RCiSXg0M3VJ3ks0UGfp98BpSSGr0kpiX3MzVl8= +github.com/cloudwego/base64x v0.1.5 h1:XPciSp1xaq2VCSt6lF0phncD4koWyULpl5bUxbfCyP4= +github.com/cloudwego/base64x v0.1.5/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/gin-contrib/gzip v0.0.5 h1:mhnVU32YnnBh2LPH2iqRqsA/eR7SAqRaD388jL2s/j0= -github.com/gin-contrib/gzip v0.0.5/go.mod h1:OPIK6HR0Um2vNmBUTlayD7qle4yVVRZT0PyhdUigrKk= -github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= -github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.7.4/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= -github.com/gin-gonic/gin v1.7.7 h1:3DoBmSbJbZAWqXJC3SLjAPfutPJJRN1U5pALB7EeTTs= -github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U= -github.com/go-fonts/dejavu v0.1.0 h1:JSajPXURYqpr+Cu8U9bt8K+XcACIHWqWrvWCKyeFmVQ= -github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= -github.com/go-fonts/latin-modern v0.2.0 h1:5/Tv1Ek/QCr20C6ZOz15vw3g7GELYL98KWr8Hgo+3vk= -github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks= -github.com/go-fonts/liberation v0.2.0 h1:jAkAWJP4S+OsrPLZM4/eC9iW7CtHy+HBXrEwZXWo5VM= -github.com/go-fonts/liberation v0.2.0/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= -github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmnUIzUY= -github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81 h1:6zl3BbBhdnMkpSj2YY30qV3gDcVBGtFgVsV3+/i+mKQ= -github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk= -github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= -github.com/go-pdf/fpdf v0.6.0 h1:MlgtGIfsdMEEQJr2le6b/HNr1ZlQwxyWr77r2aj2U/8= -github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= -github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= -github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= +github.com/gabriel-vasile/mimetype v1.4.9 h1:5k+WDwEsD9eTLL8Tz3L0VnmVh9QxGjRmjBvAG7U/oYY= +github.com/gabriel-vasile/mimetype v1.4.9/go.mod h1:WnSQhFKJuBlRyLiKohA/2DtIlPFAbguNaG7QCHcyGok= +github.com/gin-contrib/gzip v1.2.3 h1:dAhT722RuEG330ce2agAs75z7yB+NKvX/ZM1r8w0u2U= +github.com/gin-contrib/gzip v1.2.3/go.mod h1:ad72i4Bzmaypk8M762gNXa2wkxxjbz0icRNnuLJ9a/c= +github.com/gin-contrib/sse v1.1.0 h1:n0w2GMuUpWDVp7qSpvze6fAu9iRxJY4Hmj6AmBOU05w= +github.com/gin-contrib/sse v1.1.0/go.mod h1:hxRZ5gVpWMT7Z0B0gSNYqqsSCNIJMjzvm6fqCz9vjwM= +github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU= +github.com/gin-gonic/gin v1.10.0/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y= +github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.26.0 h1:SP05Nqhjcvz81uJaRfEV0YBSSSGMc/iMaVtFbr3Sw2k= +github.com/go-playground/validator/v10 v10.26.0/go.mod h1:I5QpIEbmr8On7W0TktmJAumgzX4CA1XNl4ZmDuVHKKo= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= +github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4= +github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/gocolly/colly v1.2.0 h1:qRz9YAn8FIH0qzgNUw+HT9UN7wm1oF9OBAilwEWpyrI= github.com/gocolly/colly v1.2.0/go.mod h1:Hof5T3ZswNVsOHYmba1u03W65HDWgpV5HifSuueE0EA= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ= +github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8/go.mod h1:wcDNUvekVysuuOpQKo3191zZyTpiI6se1N1ULghS0sw= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/gomarkdown/markdown v0.0.0-20220627144906-e9a81102ebeb h1:5b/eFaSaKPFG9ygDBaPKkydKU5nFJYk08g9jPIVogMg= -github.com/gomarkdown/markdown v0.0.0-20220627144906-e9a81102ebeb/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/golang/snappy v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs= +github.com/golang/snappy v1.0.0/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/gomarkdown/markdown v0.0.0-20250311123330-531bef5e742b h1:EY/KpStFl60qA17CptGXhwfZ+k1sFNJIUNR8DdbcuUk= +github.com/gomarkdown/markdown v0.0.0-20250311123330-531bef5e742b/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/go-github/v44 v44.1.0 h1:shWPaufgdhr+Ad4eo/pZv9ORTxFpsxPEPEuuXAKIQGA= github.com/google/go-github/v44 v44.1.0/go.mod h1:iWn00mWcP6PRWHhXm0zuFJ8wbEjE5AGO5D5HXYM4zgw= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b h1:wDUNC2eKiL35DbLvsDhiblTUXHxcOPwQSCzi7xpQUN4= github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b/go.mod h1:VzxiSdG6j1pi7rwGm/xYI5RbtpBgM8sARDXlvEvxlu0= -github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kennygrant/sanitize v1.2.4 h1:gN25/otpP5vAsO2djbMhF/LQX6R7+O1TB4yv8NzpJ3o= github.com/kennygrant/sanitize v1.2.4/go.mod h1:LGsjYYtgxbetdg5owWB2mpgUL6e2nfw2eObZ0u0qvak= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kljensen/snowball v0.6.0 h1:6DZLCcZeL0cLfodx+Md4/OLC6b/bfurWUOUGs1ydfOU= -github.com/kljensen/snowball v0.6.0/go.mod h1:27N7E8fVU5H68RlUmnWwZCfxgt4POBJfENGMvNRhldw= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE= +github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= +github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= -github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= -github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/mschoch/smat v0.2.0 h1:8imxQsjDm8yFEAVBe7azKmKSgzSkZXDuKkSq9374khM= +github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw= +github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= +github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= -github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= -github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca h1:NugYot0LIVPxTvN8n+Kvkn6TrbMyxQiuvKdEwFdR9vI= -github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca/go.mod h1:uugorj2VCxiV1x+LzaIdVa9b4S4qGAcH6cbhh4qVxOU= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d h1:hrujxIzL1woJ7AwssoOcM/tq5JjjG2yYOc8odClEiXA= +github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d/go.mod h1:uugorj2VCxiV1x+LzaIdVa9b4S4qGAcH6cbhh4qVxOU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/temoto/robotstxt v1.1.2 h1:W2pOjSJ6SWvldyEuiFXNxz3xZ8aiWX5LbfDiOFd7Fxg= github.com/temoto/robotstxt v1.1.2/go.mod h1:+1AmkuG3IYkh1kv0d2qEB9Le88ehNO0zwOr3ujewlOo= -github.com/timshannon/bolthold v0.0.0-20210913165410-232392fc8a6a h1:oIi7H/bwFUYKYhzKbHc+3MvHRWqhQwXVB4LweLMiVy0= -github.com/timshannon/bolthold v0.0.0-20210913165410-232392fc8a6a/go.mod h1:iSvujNDmpZ6eQX+bg/0X3lF7LEmZ8N77g2a/J/+Zt2U= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/timshannon/bolthold v0.0.0-20240314194003-30aac6950928 h1:zjNCuOOhh1TKRU0Ru3PPPJt80z7eReswCao91gBLk00= +github.com/timshannon/bolthold v0.0.0-20240314194003-30aac6950928/go.mod h1:PCFYfAEfKT+Nd6zWvUpsXduMR1bXFLf0uGSlEF05MCI= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= +github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.4.0 h1:TU77id3TnN/zKr7CO/uk+fBCwF2jGcMuw2B/FMAzYIk= +go.etcd.io/bbolt v1.4.0/go.mod h1:AsD+OCi/qPN1giOX1aiLAha3o1U8rAz65bvN4j0sRuk= +go.etcd.io/gofail v0.1.0/go.mod h1:VZBCXYGZhHAinaBiiqYvuDynvahNsAyLFwB3kEHKz1M= +golang.org/x/arch v0.16.0 h1:foMtLTdyOmIniqWCHjY6+JxuC54XP1fDwx4N0ASyW+U= +golang.org/x/arch v0.16.0/go.mod h1:JmwW7aLIoRUKgaTzhkiEFxvcEiQGyOg9BMonBJUS7EE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/exp v0.0.0-20220827204233-334a2380cb91 h1:tnebWN09GYg9OLPss1KXj8txwZc6X6uMr6VFdcGNbHw= -golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= -golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= -golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= -golang.org/x/image v0.6.0 h1:bR8b5okrPI3g/gyZakLZHeWxAR8Dn5CyxXv1hLH5g/4= -golang.org/x/image v0.6.0/go.mod h1:MXLdDR43H7cDJq5GEGXEVeeNhPgi+YYEQ2pC1byI1x0= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= +golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= +golang.org/x/image v0.26.0 h1:4XjIFEZWQmCZi6Wv8BoxsDhRU3RVnLX04dToTDAEPlY= +golang.org/x/image v0.26.0/go.mod h1:lcxbMFAovzpnJxzXS3nyL83K27tmqtKzIJpctK8YO5c= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= +golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= +golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= +golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= +golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= +golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gonum.org/v1/gonum v0.12.0 h1:xKuo6hzt+gMav00meVPUlXwSdoEJP46BR+wdxQEFK2o= -gonum.org/v1/plot v0.12.0 h1:y1ZNmfz/xHuHvtgFe8USZVyykQo5ERXPnspQNVK15Og= -gonum.org/v1/plot v0.12.0/go.mod h1:PgiMf9+3A3PnZdJIciIXmyN1FwdAA6rXELSN761oQkw= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= +gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= +gonum.org/v1/plot v0.16.0 h1:dK28Qx/Ky4VmPUN/2zeW0ELyM6ucDnBAj5yun7M9n1g= +gonum.org/v1/plot v0.16.0/go.mod h1:Xz6U1yDMi6Ni6aaXILqmVIb6Vro8E+K7Q/GeeH+Pn0c= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= +google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= rsc.io/pdf v0.1.1 h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/release_tag.pl b/release_tag.pl deleted file mode 100755 index 4eecdba..0000000 --- a/release_tag.pl +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/perl - -open my $fh, "<", "version/version.go" || die "oops"; -while (my $l = <$fh>) { - if ($l =~ m/const Tag = "(.+)"/) { - $tag = $1; - system ('git', 'tag', '-a', $tag, '-m', "version $tag for release") ; - die "could not tag?\n" if $? != 0; - system ('git', 'push', 'origin', $tag); - die "could not push tag?\n" if $? != 0; - exit 0; - } -} - -die "no version in version/version.go?\n"; diff --git a/version/version.go b/version/version.go index 70486eb..8b719b8 100644 --- a/version/version.go +++ b/version/version.go @@ -3,6 +3,7 @@ package version import ( "context" "fmt" + "log" "strings" "sync" @@ -10,11 +11,20 @@ import ( "golang.org/x/mod/semver" ) -const Tag = "v0.0.36" +var version string // populated by goreleaser, without leading 'v' +var commit string +var date string + +var VersionInfo Info + +func init() { + VersionInfo.Remote.Valid = false + VersionInfo.Local.Version = "v" + version +} type Info struct { Local struct { - Tag string + Version string } Remote struct { Valid bool @@ -24,23 +34,29 @@ type Info struct { m sync.Mutex } -var VersionInfo Info - -func init() { - VersionInfo.Remote.Valid = false - VersionInfo.Local.Tag = Tag -} - func (vi *Info) UpgradeAvailable() bool { vi.m.Lock() defer vi.m.Unlock() if !vi.Remote.Valid { return false } - if semver.Compare(vi.Local.Tag, vi.Remote.Tag) < 0 { - return true + + log.Printf("checking if upgrade available - local %s remote %s", vi.Local.Version, vi.Remote.Tag) + localValid := semver.IsValid(vi.Local.Version) + remoteValid := semver.IsValid(vi.Remote.Tag) + + if !localValid { + log.Printf("version %s invalid", vi.Local.Version) } - return false + if !remoteValid { + log.Printf("version %s invalid", vi.Remote.Tag) + } + + if !localValid || !remoteValid { + return false + } + + return semver.Compare(vi.Local.Version, vi.Remote.Tag) < 0 } func (vi *Info) UpdateVersionInfo() { @@ -59,7 +75,7 @@ func (vi *Info) UpdateVersionInfo() { vi.Remote.Valid = true vi.UpgradeReleaseNotes = "" for _, r := range rels { - if semver.Compare(VersionInfo.Local.Tag, *r.TagName) < 0 { + if semver.Compare(VersionInfo.Local.Version, *r.TagName) < 0 { vi.UpgradeReleaseNotes += fmt.Sprintf("*Version %s*\n\n", *r.TagName) bodyLines := strings.Split(*r.Body, "\n") for _, l := range bodyLines { diff --git a/web/templates/_layout.html b/web/templates/_layout.html index 22560c0..6f25b52 100644 --- a/web/templates/_layout.html +++ b/web/templates/_layout.html @@ -23,6 +23,7 @@
  • Admin