MCPcopy
hub / github.com/grafana/tempo / List

Method List

tempodb/backend/azure/azure.go:171–200  ·  view source on GitHub ↗

List implements backend.Reader

(ctx context.Context, keypath backend.KeyPath)

Source from the content-addressed store, hash-verified

169
170// List implements backend.Reader
171func (rw *Azure) List(ctx context.Context, keypath backend.KeyPath) ([]string, error) {
172 keypath = backend.KeyPathWithPrefix(keypath, rw.cfg.Prefix)
173
174 prefix := path.Join(keypath...)
175
176 if len(prefix) > 0 {
177 prefix += dir
178 }
179
180 pager := rw.containerClient.NewListBlobsHierarchyPager(dir, &container.ListBlobsHierarchyOptions{
181 Include: container.ListBlobsInclude{},
182 Prefix: &prefix,
183 })
184
185 objects := make([]string, 0)
186 for pager.More() {
187 page, err := pager.NextPage(ctx)
188 if err != nil {
189 return objects, fmt.Errorf("iterating tenants: %w", err)
190 }
191
192 for _, b := range page.Segment.BlobPrefixes {
193 if b.Name == nil {
194 return objects, fmt.Errorf("unexpected empty blob name when listing %s: %w", prefix, err)
195 }
196 objects = append(objects, strings.TrimPrefix(strings.TrimSuffix(*b.Name, dir), prefix))
197 }
198 }
199 return objects, nil
200}
201
202// ListBlocks implements backend.Reader
203func (rw *Azure) ListBlocks(ctx context.Context, tenant string) ([]uuid.UUID, []uuid.UUID, error) {

Callers

nothing calls this directly

Calls 3

KeyPathWithPrefixFunction · 0.92
NextPageMethod · 0.80
JoinMethod · 0.65

Tested by

no test coverage detected