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

Method Index

pkg/cache/redis/index.go:32–46  ·  view source on GitHub ↗

Index retrieves and deserializes the index from Redis.

()

Source from the content-addressed store, hash-verified

30
31// Index retrieves and deserializes the index from Redis.
32func (s *IndexStorage) Index() (*index.Index, error) {
33 data, err := s.client.Get(ctx, withNamespace(s.namespacePrefix, indexPrefix, "")).Bytes()
34 if err != nil {
35 if err == redis.Nil {
36 return &index.Index{Version: 2}, nil
37 }
38 }
39
40 var idx index.Index
41 if err := json.Unmarshal(data, &idx); err != nil {
42 return nil, err
43 }
44
45 return &idx, nil
46}

Callers

nothing calls this directly

Calls 1

withNamespaceFunction · 0.85

Tested by

no test coverage detected