From a597c5df0f9f19058b2c83fde7e7777e1d762581 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 29 Jun 2024 18:11:11 +0200
Subject: refactor: rename go module
---
internal/components/data.go | 8 ++++----
internal/components/detail.templ | 2 +-
internal/components/markdown.templ | 2 +-
internal/components/optionDetail.templ | 2 +-
internal/components/options.templ | 4 ++--
internal/components/packageDetail.templ | 2 +-
internal/components/packages.templ | 4 ++--
internal/components/page.templ | 4 ++--
internal/components/results.templ | 2 +-
internal/fetcher/channel.go | 5 +++--
internal/fetcher/download.go | 5 +++--
internal/fetcher/http.go | 3 ++-
internal/fetcher/main.go | 5 +++--
internal/fetcher/nixpkgs-channel.go | 5 +++--
internal/importer/importer.go | 5 +++--
internal/importer/main.go | 7 ++++---
internal/importer/main_test.go | 5 +++--
internal/importer/options.go | 5 +++--
internal/importer/package.go | 5 +++--
internal/importer/utils.go | 5 +++--
internal/index/index_meta.go | 3 ++-
internal/index/indexer.go | 5 +++--
internal/index/search.go | 5 +++--
internal/nix/importable.go | 3 ++-
internal/opensearch/opensearch.go | 3 ++-
internal/server/error.go | 4 ++--
internal/server/headers.go | 5 +++--
internal/server/mux.go | 10 +++++-----
internal/server/server.go | 5 +++--
29 files changed, 73 insertions(+), 55 deletions(-)
(limited to 'internal')
diff --git a/internal/components/data.go b/internal/components/data.go
index 64caeaa..8f4fe62 100644
--- a/internal/components/data.go
+++ b/internal/components/data.go
@@ -1,10 +1,10 @@
package components
import (
- "searchix/frontend"
- "searchix/internal/config"
- search "searchix/internal/index"
- "searchix/internal/nix"
+ "go.alanpearce.eu/searchix/frontend"
+ "go.alanpearce.eu/searchix/internal/config"
+ search "go.alanpearce.eu/searchix/internal/index"
+ "go.alanpearce.eu/searchix/internal/nix"
"github.com/blevesearch/bleve/v2"
)
diff --git a/internal/components/detail.templ b/internal/components/detail.templ
index 6d6710c..fa7206c 100644
--- a/internal/components/detail.templ
+++ b/internal/components/detail.templ
@@ -1,7 +1,7 @@
package components
import (
- "searchix/internal/nix"
+ "go.alanpearce.eu/searchix/internal/nix"
)
templ Detail(thing nix.Importable) {
diff --git a/internal/components/markdown.templ b/internal/components/markdown.templ
index 2a8787d..ff1212f 100644
--- a/internal/components/markdown.templ
+++ b/internal/components/markdown.templ
@@ -3,7 +3,7 @@ package components
import (
"regexp"
- "searchix/internal/nix"
+ "go.alanpearce.eu/searchix/internal/nix"
"github.com/yuin/goldmark"
"github.com/yuin/goldmark/extension"
diff --git a/internal/components/optionDetail.templ b/internal/components/optionDetail.templ
index 52ce859..6eaafb4 100644
--- a/internal/components/optionDetail.templ
+++ b/internal/components/optionDetail.templ
@@ -1,6 +1,6 @@
package components
-import "searchix/internal/nix"
+import "go.alanpearce.eu/searchix/internal/nix"
templ OptionDetail(option nix.Option) {
{ option.Name }
diff --git a/internal/components/options.templ b/internal/components/options.templ
index 44bc5a3..8e31132 100644
--- a/internal/components/options.templ
+++ b/internal/components/options.templ
@@ -1,8 +1,8 @@
package components
import (
- "searchix/internal/index"
- "searchix/internal/nix"
+ "go.alanpearce.eu/searchix/internal/index"
+ "go.alanpearce.eu/searchix/internal/nix"
)
templ Options(result *index.Result) {
diff --git a/internal/components/packageDetail.templ b/internal/components/packageDetail.templ
index 7b4a5cb..65c74aa 100644
--- a/internal/components/packageDetail.templ
+++ b/internal/components/packageDetail.templ
@@ -1,7 +1,7 @@
package components
import (
- "searchix/internal/nix"
+ "go.alanpearce.eu/searchix/internal/nix"
)
func licenseName(l nix.License) string {
diff --git a/internal/components/packages.templ b/internal/components/packages.templ
index e811220..b90fcd5 100644
--- a/internal/components/packages.templ
+++ b/internal/components/packages.templ
@@ -1,8 +1,8 @@
package components
import (
- "searchix/internal/index"
- "searchix/internal/nix"
+ "go.alanpearce.eu/searchix/internal/index"
+ "go.alanpearce.eu/searchix/internal/nix"
)
templ Packages(result *index.Result) {
diff --git a/internal/components/page.templ b/internal/components/page.templ
index 9b278e2..da0322e 100644
--- a/internal/components/page.templ
+++ b/internal/components/page.templ
@@ -3,8 +3,8 @@ package components
import (
"net/url"
- "searchix/internal/config"
- "searchix/frontend"
+ "go.alanpearce.eu/searchix/internal/config"
+ "go.alanpearce.eu/searchix/frontend"
)
templ Page(tdata TemplateData) {
diff --git a/internal/components/results.templ b/internal/components/results.templ
index 95c5390..4897638 100644
--- a/internal/components/results.templ
+++ b/internal/components/results.templ
@@ -3,7 +3,7 @@ package components
import (
"strconv"
"log/slog"
- "searchix/internal/nix"
+ "go.alanpearce.eu/searchix/internal/nix"
)
func convertMatch[I nix.Importable](m nix.Importable) *I {
diff --git a/internal/fetcher/channel.go b/internal/fetcher/channel.go
index 01c4ae8..2bde631 100644
--- a/internal/fetcher/channel.go
+++ b/internal/fetcher/channel.go
@@ -7,12 +7,13 @@ import (
"os"
"os/exec"
"path"
- "searchix/internal/config"
- "searchix/internal/index"
"strconv"
"strings"
"time"
+ "go.alanpearce.eu/searchix/internal/config"
+ "go.alanpearce.eu/searchix/internal/index"
+
"github.com/pkg/errors"
)
diff --git a/internal/fetcher/download.go b/internal/fetcher/download.go
index 7de6f26..941a683 100644
--- a/internal/fetcher/download.go
+++ b/internal/fetcher/download.go
@@ -5,8 +5,9 @@ import (
"fmt"
"log/slog"
"net/url"
- "searchix/internal/config"
- "searchix/internal/index"
+
+ "go.alanpearce.eu/searchix/internal/config"
+ "go.alanpearce.eu/searchix/internal/index"
"github.com/pkg/errors"
)
diff --git a/internal/fetcher/http.go b/internal/fetcher/http.go
index 1a47f11..c848dc9 100644
--- a/internal/fetcher/http.go
+++ b/internal/fetcher/http.go
@@ -6,10 +6,11 @@ import (
"io"
"log/slog"
"net/http"
- "searchix/internal/config"
"strings"
"time"
+ "go.alanpearce.eu/searchix/internal/config"
+
"github.com/andybalholm/brotli"
"github.com/pkg/errors"
)
diff --git a/internal/fetcher/main.go b/internal/fetcher/main.go
index 7ea0b03..fcc04a9 100644
--- a/internal/fetcher/main.go
+++ b/internal/fetcher/main.go
@@ -4,8 +4,9 @@ import (
"context"
"io"
"log/slog"
- "searchix/internal/config"
- "searchix/internal/index"
+
+ "go.alanpearce.eu/searchix/internal/config"
+ "go.alanpearce.eu/searchix/internal/index"
"github.com/pkg/errors"
)
diff --git a/internal/fetcher/nixpkgs-channel.go b/internal/fetcher/nixpkgs-channel.go
index 62fea13..ca33ae6 100644
--- a/internal/fetcher/nixpkgs-channel.go
+++ b/internal/fetcher/nixpkgs-channel.go
@@ -5,8 +5,9 @@ import (
"fmt"
"log/slog"
"net/url"
- "searchix/internal/config"
- "searchix/internal/index"
+
+ "go.alanpearce.eu/searchix/internal/config"
+ "go.alanpearce.eu/searchix/internal/index"
"github.com/pkg/errors"
)
diff --git a/internal/importer/importer.go b/internal/importer/importer.go
index 6803f00..31d13c1 100644
--- a/internal/importer/importer.go
+++ b/internal/importer/importer.go
@@ -3,9 +3,10 @@ package importer
import (
"context"
"log/slog"
- "searchix/internal/index"
- "searchix/internal/nix"
"sync"
+
+ "go.alanpearce.eu/searchix/internal/index"
+ "go.alanpearce.eu/searchix/internal/nix"
)
type Importer interface {
diff --git a/internal/importer/main.go b/internal/importer/main.go
index bd41af2..bbd8b6c 100644
--- a/internal/importer/main.go
+++ b/internal/importer/main.go
@@ -5,13 +5,14 @@ import (
"fmt"
"log/slog"
"os/exec"
- "searchix/internal/config"
- "searchix/internal/fetcher"
- "searchix/internal/index"
"slices"
"strings"
"time"
+ "go.alanpearce.eu/searchix/internal/config"
+ "go.alanpearce.eu/searchix/internal/fetcher"
+ "go.alanpearce.eu/searchix/internal/index"
+
"github.com/pkg/errors"
)
diff --git a/internal/importer/main_test.go b/internal/importer/main_test.go
index bbb91a3..cb4d1db 100644
--- a/internal/importer/main_test.go
+++ b/internal/importer/main_test.go
@@ -2,9 +2,10 @@ package importer
import (
"log/slog"
- "searchix/internal/config"
- "searchix/internal/index"
"testing"
+
+ "go.alanpearce.eu/searchix/internal/config"
+ "go.alanpearce.eu/searchix/internal/index"
)
var cfg = config.DefaultConfig
diff --git a/internal/importer/options.go b/internal/importer/options.go
index c26836e..290e2e3 100644
--- a/internal/importer/options.go
+++ b/internal/importer/options.go
@@ -5,8 +5,9 @@ import (
"io"
"log/slog"
"reflect"
- "searchix/internal/config"
- "searchix/internal/nix"
+
+ "go.alanpearce.eu/searchix/internal/config"
+ "go.alanpearce.eu/searchix/internal/nix"
"github.com/bcicen/jstream"
"github.com/mitchellh/mapstructure"
diff --git a/internal/importer/package.go b/internal/importer/package.go
index 4e193db..5a0ea00 100644
--- a/internal/importer/package.go
+++ b/internal/importer/package.go
@@ -5,10 +5,11 @@ import (
"encoding/json"
"io"
"reflect"
- "searchix/internal/config"
- "searchix/internal/nix"
"strings"
+ "go.alanpearce.eu/searchix/internal/config"
+ "go.alanpearce.eu/searchix/internal/nix"
+
"github.com/bcicen/jstream"
"github.com/mitchellh/mapstructure"
"github.com/pkg/errors"
diff --git a/internal/importer/utils.go b/internal/importer/utils.go
index 7c53173..da10735 100644
--- a/internal/importer/utils.go
+++ b/internal/importer/utils.go
@@ -4,10 +4,11 @@ import (
"fmt"
"io"
"net/url"
- "searchix/internal/config"
- "searchix/internal/nix"
"strings"
+ "go.alanpearce.eu/searchix/internal/config"
+ "go.alanpearce.eu/searchix/internal/nix"
+
"github.com/bcicen/jstream"
"github.com/pkg/errors"
)
diff --git a/internal/index/index_meta.go b/internal/index/index_meta.go
index 47aa858..fe1b26c 100644
--- a/internal/index/index_meta.go
+++ b/internal/index/index_meta.go
@@ -4,9 +4,10 @@ import (
"encoding/json"
"log/slog"
"os"
- "searchix/internal/file"
"time"
+ "go.alanpearce.eu/searchix/internal/file"
+
"github.com/pkg/errors"
)
diff --git a/internal/index/indexer.go b/internal/index/indexer.go
index 600ea9b..62edbc1 100644
--- a/internal/index/indexer.go
+++ b/internal/index/indexer.go
@@ -10,10 +10,11 @@ import (
"math"
"os"
"path"
- "searchix/internal/file"
- "searchix/internal/nix"
"slices"
+ "go.alanpearce.eu/searchix/internal/file"
+ "go.alanpearce.eu/searchix/internal/nix"
+
"github.com/blevesearch/bleve/v2"
"github.com/blevesearch/bleve/v2/analysis/analyzer/custom"
"github.com/blevesearch/bleve/v2/analysis/analyzer/keyword"
diff --git a/internal/index/search.go b/internal/index/search.go
index 3198afb..dc19db4 100644
--- a/internal/index/search.go
+++ b/internal/index/search.go
@@ -4,8 +4,9 @@ import (
"bytes"
"context"
"encoding/gob"
- "searchix/internal/config"
- "searchix/internal/nix"
+
+ "go.alanpearce.eu/searchix/internal/config"
+ "go.alanpearce.eu/searchix/internal/nix"
"github.com/blevesearch/bleve/v2"
"github.com/blevesearch/bleve/v2/analysis/analyzer/standard"
diff --git a/internal/nix/importable.go b/internal/nix/importable.go
index 67ba96d..46d46e3 100644
--- a/internal/nix/importable.go
+++ b/internal/nix/importable.go
@@ -2,7 +2,8 @@ package nix
import (
"encoding/gob"
- "searchix/internal/config"
+
+ "go.alanpearce.eu/searchix/internal/config"
)
type Importable interface {
diff --git a/internal/opensearch/opensearch.go b/internal/opensearch/opensearch.go
index a9b3c9c..1371014 100644
--- a/internal/opensearch/opensearch.go
+++ b/internal/opensearch/opensearch.go
@@ -2,7 +2,8 @@ package opensearch
import (
"encoding/xml"
- "searchix/internal/config"
+
+ "go.alanpearce.eu/searchix/internal/config"
)
type Description struct {
diff --git a/internal/server/error.go b/internal/server/error.go
index 4a8acbc..d9d6778 100644
--- a/internal/server/error.go
+++ b/internal/server/error.go
@@ -4,8 +4,8 @@ import (
"log/slog"
"net/http"
- "searchix/internal/components"
- "searchix/internal/config"
+ "go.alanpearce.eu/searchix/internal/components"
+ "go.alanpearce.eu/searchix/internal/config"
)
func createErrorHandler(
diff --git a/internal/server/headers.go b/internal/server/headers.go
index 7ff9fb9..9a54380 100644
--- a/internal/server/headers.go
+++ b/internal/server/headers.go
@@ -2,7 +2,8 @@ package server
import (
"net/http"
- cfg "searchix/internal/config"
+
+ cfg "go.alanpearce.eu/searchix/internal/config"
)
func AddHeadersMiddleware(next http.Handler, config *cfg.Config) http.Handler {
@@ -11,7 +12,7 @@ func AddHeadersMiddleware(next http.Handler, config *cfg.Config) http.Handler {
w.Header().Add(h, v)
}
w.Header().Add("Content-Security-Policy", config.Web.ContentSecurityPolicy.String())
- w.Header().Add("Server", "searchix/"+cfg.Version)
+ w.Header().Add("Server", "go.alanpearce.eu/searchix/"+cfg.Version)
next.ServeHTTP(w, r)
})
diff --git a/internal/server/mux.go b/internal/server/mux.go
index 8ca5758..d0984da 100644
--- a/internal/server/mux.go
+++ b/internal/server/mux.go
@@ -14,11 +14,11 @@ import (
"strconv"
"time"
- "searchix/frontend"
- "searchix/internal/components"
- "searchix/internal/config"
- search "searchix/internal/index"
- "searchix/internal/opensearch"
+ "go.alanpearce.eu/searchix/frontend"
+ "go.alanpearce.eu/searchix/internal/components"
+ "go.alanpearce.eu/searchix/internal/config"
+ search "go.alanpearce.eu/searchix/internal/index"
+ "go.alanpearce.eu/searchix/internal/opensearch"
sentryhttp "github.com/getsentry/sentry-go/http"
"github.com/osdevisnot/sorvor/pkg/livereload"
diff --git a/internal/server/server.go b/internal/server/server.go
index 38200bb..c3c2a4d 100644
--- a/internal/server/server.go
+++ b/internal/server/server.go
@@ -5,11 +5,12 @@ import (
"log/slog"
"net"
"net/http"
- "searchix/internal/config"
- "searchix/internal/index"
"strconv"
"time"
+ "go.alanpearce.eu/searchix/internal/config"
+ "go.alanpearce.eu/searchix/internal/index"
+
"github.com/pkg/errors"
"golang.org/x/net/http2"
"golang.org/x/net/http2/h2c"
--
cgit 1.4.1