1
0

meta.go 527 B

12345678910111213141516171819202122
  1. package monitoring
  2. // Metadata key names
  3. const (
  4. MetaSourceImageURL = "imgproxy.source_image_url"
  5. MetaSourceImageOrigin = "imgproxy.source_image_origin"
  6. MetaOptions = "imgproxy.options"
  7. )
  8. // Meta represents a set of metadata key-value pairs.
  9. type Meta map[string]any
  10. // Filter creates a copy of Meta with only the specified keys.
  11. func (m Meta) Filter(only ...string) Meta {
  12. filtered := make(Meta)
  13. for _, key := range only {
  14. if value, ok := m[key]; ok {
  15. filtered[key] = value
  16. }
  17. }
  18. return filtered
  19. }