mirror of
https://github.com/hanzoai/o11y.git
synced 2026-10-15 12:58:33 +00:00
Full rebrand of the SigNoz observability platform: - Go module: github.com/SigNoz/signoz → github.com/hanzoai/o11y - Frontend: @signozhq/* → @hanzo/o11y-*, posthog-js → @hanzo/insights - Docker: signoz/* → ghcr.io/hanzoai/o11y* - ClickHouse → Hanzo Datastore (hanzoai/datastore) - Env vars: SIGNOZ_* → HANZO_* - DB tables: signoz_* → o11y_* - All branding, URLs, docs updated - 2172 files changed
31 lines
1.0 KiB
Go
31 lines
1.0 KiB
Go
package cache
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
v3 "github.com/hanzoai/o11y/pkg/query-service/model/v3"
|
|
"github.com/hanzoai/o11y/pkg/types/cachetypes"
|
|
"github.com/hanzoai/o11y/pkg/valuer"
|
|
)
|
|
|
|
type Cache interface {
|
|
// Set sets the cacheable entity in cache.
|
|
Set(ctx context.Context, orgID valuer.UUID, cacheKey string, data cachetypes.Cacheable, ttl time.Duration) error
|
|
|
|
// Get gets the cacheble entity in the dest entity passed.
|
|
Get(ctx context.Context, orgID valuer.UUID, cacheKey string, dest cachetypes.Cacheable) error
|
|
|
|
// Delete deletes the cacheable entity from cache
|
|
Delete(ctx context.Context, orgID valuer.UUID, cacheKey string)
|
|
|
|
// DeleteMany deletes multiple cacheble entities from cache
|
|
DeleteMany(ctx context.Context, orgID valuer.UUID, cacheKeys []string)
|
|
}
|
|
|
|
type KeyGenerator interface {
|
|
// GenerateKeys generates the cache keys for the given query range params
|
|
// The keys are returned as a map where the key is the query name and the value is the cache key
|
|
GenerateKeys(*v3.QueryRangeParamsV3) map[string]string
|
|
}
|