rename: kafka → samsa
Full project rename from kafka to samsa (after Gregor Samsa, who woke one morning from uneasy dreams to find himself transformed). - Module: github.com/metamorphosis-dev/kafka → samsa - Binary: cmd/kafka/ → cmd/samsa/ - CSS: kafka.css → samsa.css - UI: all 'kafka' product names, titles, localStorage keys → samsa - localStorage keys: kafka-theme → samsa-theme, kafka-engines → samsa-engines - OpenSearch: ShortName, LongName, description, URLs updated - AGPL headers: 'kafka' → 'samsa' - Docs, configs, examples updated - Cache key prefix: kafka: → samsa:
This commit is contained in:
parent
c91908a427
commit
8e9aae062b
70 changed files with 185 additions and 184 deletions
10
internal/cache/cache.go
vendored
10
internal/cache/cache.go
vendored
|
|
@ -1,4 +1,4 @@
|
|||
// kafka — a privacy-respecting metasearch engine
|
||||
// samsa — a privacy-respecting metasearch engine
|
||||
// Copyright (C) 2026-present metamorphosis-dev
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -25,7 +25,7 @@ import (
|
|||
"log/slog"
|
||||
"time"
|
||||
|
||||
"github.com/metamorphosis-dev/kafka/internal/contracts"
|
||||
"github.com/metamorphosis-dev/samsa/internal/contracts"
|
||||
"github.com/redis/go-redis/v9"
|
||||
)
|
||||
|
||||
|
|
@ -97,7 +97,7 @@ func (c *Cache) Get(ctx context.Context, key string) (contracts.SearchResponse,
|
|||
return contracts.SearchResponse{}, false
|
||||
}
|
||||
|
||||
fullKey := "kafka:" + key
|
||||
fullKey := "samsa:" + key
|
||||
|
||||
data, err := c.client.Get(ctx, fullKey).Bytes()
|
||||
if err != nil {
|
||||
|
|
@ -129,7 +129,7 @@ func (c *Cache) Set(ctx context.Context, key string, resp contracts.SearchRespon
|
|||
return
|
||||
}
|
||||
|
||||
fullKey := "kafka:" + key
|
||||
fullKey := "samsa:" + key
|
||||
if err := c.client.Set(ctx, fullKey, data, c.ttl).Err(); err != nil {
|
||||
c.logger.Warn("cache set failed", "key", fullKey, "error", err)
|
||||
}
|
||||
|
|
@ -140,7 +140,7 @@ func (c *Cache) Invalidate(ctx context.Context, key string) {
|
|||
if !c.Enabled() {
|
||||
return
|
||||
}
|
||||
fullKey := "kafka:" + key
|
||||
fullKey := "samsa:" + key
|
||||
c.client.Del(ctx, fullKey)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue