meta fetches the metadata for the specified blob from the index.
(br blob.Ref)
| 726 | |
| 727 | // meta fetches the metadata for the specified blob from the index. |
| 728 | func (s *storage) meta(br blob.Ref) (m blobMeta, err error) { |
| 729 | ms, err := s.index.Get(br.String()) |
| 730 | if err != nil { |
| 731 | if errors.Is(err, sorted.ErrNotFound) { |
| 732 | err = os.ErrNotExist |
| 733 | } |
| 734 | return |
| 735 | } |
| 736 | m, ok := parseBlobMeta(ms) |
| 737 | if !ok { |
| 738 | err = fmt.Errorf("diskpacked: bad blob metadata: %q", ms) |
| 739 | } |
| 740 | return |
| 741 | } |
| 742 | |
| 743 | // blobMeta is the blob metadata stored in the index. |
| 744 | type blobMeta struct { |
no test coverage detected