content.go 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package headers
  2. type ContentType string
  3. // String implements stringer interface
  4. func (ct ContentType) String() string {
  5. return string(ct)
  6. }
  7. type ContentEncoding string
  8. // String implements stringer interface
  9. func (ce ContentEncoding) String() string {
  10. return string(ce)
  11. }
  12. const (
  13. ContentTypeKey = "Content-Type"
  14. ContentLength = "Content-Length"
  15. ContentEncodingKey = "Content-Encoding"
  16. ContentTypeAny ContentType = "*/*"
  17. TypeApplicationJSON ContentType = "application/json"
  18. TypeApplicationXML ContentType = "application/xml"
  19. TypeApplicationOctetStream ContentType = "application/octet-stream"
  20. TypeApplicationProtobuf ContentType = "application/protobuf"
  21. TypeApplicationMsgpack ContentType = "application/msgpack"
  22. TypeApplicationXSolomonSpack ContentType = "application/x-solomon-spack"
  23. EncodingAny ContentEncoding = "*"
  24. EncodingZSTD ContentEncoding = "zstd"
  25. EncodingLZ4 ContentEncoding = "lz4"
  26. EncodingGZIP ContentEncoding = "gzip"
  27. EncodingDeflate ContentEncoding = "deflate"
  28. TypeTextPlain ContentType = "text/plain"
  29. TypeTextHTML ContentType = "text/html"
  30. TypeTextCSV ContentType = "text/csv"
  31. TypeTextCmd ContentType = "text/cmd"
  32. TypeTextCSS ContentType = "text/css"
  33. TypeTextXML ContentType = "text/xml"
  34. TypeTextMarkdown ContentType = "text/markdown"
  35. TypeImageAny ContentType = "image/*"
  36. TypeImageJPEG ContentType = "image/jpeg"
  37. TypeImageGIF ContentType = "image/gif"
  38. TypeImagePNG ContentType = "image/png"
  39. TypeImageSVG ContentType = "image/svg+xml"
  40. TypeImageTIFF ContentType = "image/tiff"
  41. TypeImageWebP ContentType = "image/webp"
  42. TypeVideoMPEG ContentType = "video/mpeg"
  43. TypeVideoMP4 ContentType = "video/mp4"
  44. TypeVideoOgg ContentType = "video/ogg"
  45. TypeVideoWebM ContentType = "video/webm"
  46. )