MCPcopy Create free account
hub / github.com/encoder-run/operator / Config

Method Config

pkg/cache/redis/config.go:30–45  ·  view source on GitHub ↗

Config retrieves the configuration from Redis.

()

Source from the content-addressed store, hash-verified

28
29// Config retrieves the configuration from Redis.
30func (s *ConfigStorage) Config() (*config.Config, error) {
31 data, err := s.client.Get(ctx, withNamespace(s.namespacePrefix, configPrefix, "")).Bytes()
32 if err != nil {
33 // If the key does not exist, return a new configuration.
34 if err == redis.Nil {
35 return config.NewConfig(), nil
36 }
37 }
38
39 var cfg config.Config
40 if err := json.Unmarshal(data, &cfg); err != nil {
41 return nil, err
42 }
43
44 return &cfg, nil
45}

Callers

nothing calls this directly

Calls 1

withNamespaceFunction · 0.85

Tested by

no test coverage detected