chore: update Go module path to github.com/metamorphosis-dev/kafka
Module path now matches the GitHub mirror location. All internal imports updated across 35+ files.
This commit is contained in:
parent
9a6a40c817
commit
6346fb7155
36 changed files with 70 additions and 47 deletions
23
.forgejo/workflows/mirror.yml
Normal file
23
.forgejo/workflows/mirror.yml
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
name: Mirror to GitHub
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
tags: ['v*']
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
mirror:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: https://github.com/actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Push to GitHub mirror
|
||||||
|
uses: https://github.com/ad-m/github-push-action@master
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GH_MIRROR_TOKEN }}
|
||||||
|
repository: metamorphosis-dev/gosearch
|
||||||
|
branch: ${{ github.ref_name }}
|
||||||
|
force: true
|
||||||
|
|
@ -9,12 +9,12 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/cache"
|
"github.com/metamorphosis-dev/kafka/internal/cache"
|
||||||
"github.com/ashie/gosearch/internal/config"
|
"github.com/metamorphosis-dev/kafka/internal/config"
|
||||||
"github.com/ashie/gosearch/internal/httpapi"
|
"github.com/metamorphosis-dev/kafka/internal/httpapi"
|
||||||
"github.com/ashie/gosearch/internal/middleware"
|
"github.com/metamorphosis-dev/kafka/internal/middleware"
|
||||||
"github.com/ashie/gosearch/internal/search"
|
"github.com/metamorphosis-dev/kafka/internal/search"
|
||||||
"github.com/ashie/gosearch/internal/views"
|
"github.com/metamorphosis-dev/kafka/internal/views"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
||||||
2
go.mod
2
go.mod
|
|
@ -1,4 +1,4 @@
|
||||||
module github.com/ashie/gosearch
|
module github.com/metamorphosis-dev/kafka
|
||||||
|
|
||||||
go 1.25.0
|
go 1.25.0
|
||||||
|
|
||||||
|
|
|
||||||
2
internal/cache/cache.go
vendored
2
internal/cache/cache.go
vendored
|
|
@ -9,7 +9,7 @@ import (
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
"github.com/redis/go-redis/v9"
|
"github.com/redis/go-redis/v9"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
2
internal/cache/cache_test.go
vendored
2
internal/cache/cache_test.go
vendored
|
|
@ -3,7 +3,7 @@ package cache
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestKey_Deterministic(t *testing.T) {
|
func TestKey_Deterministic(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestArxivEngine_Search(t *testing.T) {
|
func TestArxivEngine_Search(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
// BingEngine searches Bing via the public Bing API.
|
// BingEngine searches Bing via the public Bing API.
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestBingEngine_EmptyQuery(t *testing.T) {
|
func TestBingEngine_EmptyQuery(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
// BraveEngine implements the SearXNG `braveapi` engine (Brave Web Search API).
|
// BraveEngine implements the SearXNG `braveapi` engine (Brave Web Search API).
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestBraveEngine_GatingAndHeader(t *testing.T) {
|
func TestBraveEngine_GatingAndHeader(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CrossrefEngine struct {
|
type CrossrefEngine struct {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCrossrefEngine_Search(t *testing.T) {
|
func TestCrossrefEngine_Search(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DuckDuckGoEngine searches DuckDuckGo's Lite/HTML endpoint.
|
// DuckDuckGoEngine searches DuckDuckGo's Lite/HTML endpoint.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
// parseDuckDuckGoHTML parses DuckDuckGo Lite's HTML response for search results.
|
// parseDuckDuckGoHTML parses DuckDuckGo Lite's HTML response for search results.
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestDuckDuckGoEngine_EmptyQuery(t *testing.T) {
|
func TestDuckDuckGoEngine_EmptyQuery(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package engines
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Engine is a Go-native implementation of a SearXNG engine.
|
// Engine is a Go-native implementation of a SearXNG engine.
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GitHubEngine searches GitHub repositories and code via the public search API.
|
// GitHubEngine searches GitHub repositories and code via the public search API.
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestGitHubEngine_EmptyQuery(t *testing.T) {
|
func TestGitHubEngine_EmptyQuery(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
var defaultPortedEngines = []string{"wikipedia", "arxiv", "crossref", "braveapi", "qwant"}
|
var defaultPortedEngines = []string{"wikipedia", "arxiv", "crossref", "braveapi", "qwant"}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
"github.com/PuerkitoBio/goquery"
|
"github.com/PuerkitoBio/goquery"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestQwantEngine_WebLite(t *testing.T) {
|
func TestQwantEngine_WebLite(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestQwantEngine_Web(t *testing.T) {
|
func TestQwantEngine_Web(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RedditEngine searches Reddit posts via the public JSON API.
|
// RedditEngine searches Reddit posts via the public JSON API.
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRedditEngine_EmptyQuery(t *testing.T) {
|
func TestRedditEngine_EmptyQuery(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
type WikipediaEngine struct {
|
type WikipediaEngine struct {
|
||||||
|
|
@ -49,7 +49,7 @@ func (e *WikipediaEngine) Search(ctx context.Context, req contracts.SearchReques
|
||||||
// Wikimedia APIs require a descriptive User-Agent.
|
// Wikimedia APIs require a descriptive User-Agent.
|
||||||
httpReq.Header.Set(
|
httpReq.Header.Set(
|
||||||
"User-Agent",
|
"User-Agent",
|
||||||
"gosearch-go/0.1 (compatible; +https://github.com/ashie/gosearch)",
|
"gosearch-go/0.1 (compatible; +https://github.com/metamorphosis-dev/kafka)",
|
||||||
)
|
)
|
||||||
// Best-effort: hint content language.
|
// Best-effort: hint content language.
|
||||||
if req.Language != "" && req.Language != "auto" {
|
if req.Language != "" && req.Language != "auto" {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestWikipediaEngine_Search(t *testing.T) {
|
func TestWikipediaEngine_Search(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@ package httpapi
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
"github.com/ashie/gosearch/internal/search"
|
"github.com/metamorphosis-dev/kafka/internal/search"
|
||||||
"github.com/ashie/gosearch/internal/views"
|
"github.com/metamorphosis-dev/kafka/internal/views"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Handler struct {
|
type Handler struct {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MergeResponses merges multiple SearXNG-compatible JSON responses.
|
// MergeResponses merges multiple SearXNG-compatible JSON responses.
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMergeResponses_DedupResultsAndSets(t *testing.T) {
|
func TestMergeResponses_DedupResultsAndSets(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,10 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/cache"
|
"github.com/metamorphosis-dev/kafka/internal/cache"
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
"github.com/ashie/gosearch/internal/engines"
|
"github.com/metamorphosis-dev/kafka/internal/engines"
|
||||||
"github.com/ashie/gosearch/internal/upstream"
|
"github.com/metamorphosis-dev/kafka/internal/upstream"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ServiceConfig struct {
|
type ServiceConfig struct {
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
"github.com/ashie/gosearch/internal/engines"
|
"github.com/metamorphosis-dev/kafka/internal/engines"
|
||||||
)
|
)
|
||||||
|
|
||||||
// mockEngine is a test engine that returns a predefined response or error.
|
// mockEngine is a test engine that returns a predefined response or error.
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package search
|
package search
|
||||||
|
|
||||||
import "github.com/ashie/gosearch/internal/contracts"
|
import "github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
|
|
||||||
// Re-export the JSON contract types so the rest of the code can stay in the
|
// Re-export the JSON contract types so the rest of the code can stay in the
|
||||||
// `internal/search` namespace without creating an import cycle.
|
// `internal/search` namespace without creating an import cycle.
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Client struct {
|
type Client struct {
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:embed all:templates
|
//go:embed all:templates
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package views
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ashie/gosearch/internal/contracts"
|
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||||
)
|
)
|
||||||
|
|
||||||
func mockSearchResponse(query string, numResults int) contracts.SearchResponse {
|
func mockSearchResponse(query string, numResults int) contracts.SearchResponse {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue