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

Method Find

tempodb/backend/local/local.go:198–227  ·  view source on GitHub ↗

Find implements backend.Reader

(_ context.Context, keypath backend.KeyPath, f backend.FindFunc)

Source from the content-addressed store, hash-verified

196
197// Find implements backend.Reader
198func (rw *Backend) Find(_ context.Context, keypath backend.KeyPath, f backend.FindFunc) (err error) {
199 path := rw.rootPath(keypath)
200 fff := os.DirFS(path)
201 err = fs.WalkDir(fff, ".", func(path string, d fs.DirEntry, err error) error {
202 if err != nil {
203 return err
204 }
205
206 if d.IsDir() {
207 return nil
208 }
209
210 info, err := d.Info()
211 if err != nil {
212 return err
213 }
214
215 tenantFilePath := filepath.Join(filepath.Join(keypath...), path)
216 opts := backend.FindMatch{
217 Key: tenantFilePath,
218 Modified: info.ModTime(),
219 }
220
221 f(opts)
222
223 return nil
224 })
225
226 return
227}
228
229// Read implements backend.Reader
230func (rw *Backend) Read(ctx context.Context, name string, keypath backend.KeyPath, _ *backend.CacheInfo) (io.ReadCloser, int64, error) {

Callers

nothing calls this directly

Calls 3

rootPathMethod · 0.95
fFunction · 0.85
JoinMethod · 0.65

Tested by

no test coverage detected