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
49 lines
999 B
Go
49 lines
999 B
Go
package cache
|
|
|
|
import (
|
|
"github.com/hanzoai/o11y/pkg/factory"
|
|
)
|
|
|
|
type Memory struct {
|
|
NumCounters int64 `mapstructure:"num_counters"`
|
|
MaxCost int64 `mapstructure:"max_cost"`
|
|
}
|
|
|
|
type Redis struct {
|
|
Host string `mapstructure:"host"`
|
|
Port int `mapstructure:"port"`
|
|
Password string `mapstructure:"password"`
|
|
DB int `mapstructure:"db"`
|
|
}
|
|
|
|
type Config struct {
|
|
Provider string `mapstructure:"provider"`
|
|
Memory Memory `mapstructure:"memory"`
|
|
Redis Redis `mapstructure:"redis"`
|
|
}
|
|
|
|
func NewConfigFactory() factory.ConfigFactory {
|
|
return factory.NewConfigFactory(factory.MustNewName("cache"), newConfig)
|
|
}
|
|
|
|
func newConfig() factory.Config {
|
|
return &Config{
|
|
Provider: "memory",
|
|
Memory: Memory{
|
|
NumCounters: 10 * 10000, // 10k cache entries * 10x as per ristretto
|
|
MaxCost: 1 << 27, // 128 MB
|
|
},
|
|
Redis: Redis{
|
|
Host: "localhost",
|
|
Port: 6379,
|
|
Password: "",
|
|
DB: 0,
|
|
},
|
|
}
|
|
|
|
}
|
|
|
|
func (c Config) Validate() error {
|
|
return nil
|
|
}
|