MCPcopy
hub / github.com/grafana/dskit / Validate

Method Validate

cache/cache.go:102–112  ·  cache/cache.go::BackendConfig.Validate

Validate the config.

()

Source from the content-addressed store, hash-verified

100
101// Validate the config.
102func (cfg *BackendConfig) Validate() error {
103 if cfg.Backend != "" && cfg.Backend != BackendMemcached {
104 return fmt.Errorf("unsupported cache backend: %s", cfg.Backend)
105 }
106
107 switch cfg.Backend {
108 case BackendMemcached:
109 return cfg.Memcached.Validate()
110 }
111 return nil
112}
113
114func CreateClient(cacheName string, cfg BackendConfig, logger log.Logger, reg prometheus.Registerer) (Cache, error) {
115 switch cfg.Backend {

Callers 2

Calls 1

ErrorfMethod · 0.80

Tested by 2