Validate the config.
()
| 100 | |
| 101 | // Validate the config. |
| 102 | func (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 | |
| 114 | func CreateClient(cacheName string, cfg BackendConfig, logger log.Logger, reg prometheus.Registerer) (Cache, error) { |
| 115 | switch cfg.Backend { |