mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-29 16:14:42 +00:00
* feat: added new cache package for query service * feat: handle type checking for inmemory * feat: some copy corrections * feat: added inmemory test cases * chore: some renaming * feat: added redis handling * chore: add redis tests * feat(cache): refactor the code * feat(cache): refactor the code * feat(cache): added defaults for redis config * feat(cache): update makefile to run all tetss * feat(cache): update tests and docs * feat(cache): update tests and docs * feat(cache): handle signoz web flag * feat(cache): handle signoz web flag * feat(cache): handle signoz web flag
36 lines
895 B
Go
36 lines
895 B
Go
package config
|
|
|
|
import (
|
|
"context"
|
|
|
|
"go.signoz.io/signoz/pkg/cache"
|
|
signozconfmap "go.signoz.io/signoz/pkg/confmap"
|
|
"go.signoz.io/signoz/pkg/instrumentation"
|
|
"go.signoz.io/signoz/pkg/web"
|
|
)
|
|
|
|
// This map contains the default values of all config structs
|
|
var (
|
|
defaults = map[string]signozconfmap.Config{
|
|
"instrumentation": &instrumentation.Config{},
|
|
"web": &web.Config{},
|
|
"cache": &cache.Config{},
|
|
}
|
|
)
|
|
|
|
// Config defines the entire configuration of signoz.
|
|
type Config struct {
|
|
Instrumentation instrumentation.Config `mapstructure:"instrumentation"`
|
|
Web web.Config `mapstructure:"web"`
|
|
Cache cache.Config `mapstructure:"cache"`
|
|
}
|
|
|
|
func New(ctx context.Context, settings ProviderSettings) (*Config, error) {
|
|
provider, err := NewProvider(settings)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return provider.Get(ctx)
|
|
}
|