(h plumbing.Hash)
| 115 | } |
| 116 | |
| 117 | func (s *Storage) HasEncodedObject(h plumbing.Hash) error { |
| 118 | pattern := withNamespace(s.namespacePrefix, objectPrefix, fmt.Sprintf("*:%s", h.String())) |
| 119 | var cursor uint64 |
| 120 | var err error |
| 121 | for { |
| 122 | var keys []string |
| 123 | keys, cursor, err = s.client.Scan(ctx, cursor, pattern, 1).Result() |
| 124 | if err != nil { |
| 125 | return err |
| 126 | } |
| 127 | if len(keys) > 0 { |
| 128 | return nil // Key exists |
| 129 | } |
| 130 | if cursor == 0 { // No more keys to scan |
| 131 | break |
| 132 | } |
| 133 | } |
| 134 | return plumbing.ErrObjectNotFound |
| 135 | } |
| 136 | |
| 137 | type EncodedObjectIter struct { |
| 138 | client *redis.Client |
nothing calls this directly
no test coverage detected