MCPcopy Create free account
hub / github.com/cloudquery/cloudquery / GetContentType

Method GetContentType

plugins/destination/s3/client/spec/spec.go:307–333  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

305}
306
307func (s *Spec) GetContentType() string {
308 if s.ContentType != "" {
309 return s.ContentType
310 }
311 switch {
312 case s.Compression == filetypes.CompressionTypeGZip:
313 // https://www.iana.org/assignments/media-types/application/gzip
314 return "application/gzip"
315 case s.Compression != "":
316 // https://www.iana.org/assignments/media-types/application/octet-stream
317 return "application/octet-stream"
318 }
319
320 switch s.Format {
321 case "json":
322 // https://www.iana.org/assignments/media-types/application/json
323 return "application/json"
324 case "csv":
325 // https://www.iana.org/assignments/media-types/text/csv
326 return "text/csv"
327 case "parquet":
328 // https://www.iana.org/assignments/media-types/application/vnd.apache.parquet
329 return "application/vnd.apache.parquet"
330 }
331 // This is the default content type for all unknown files
332 return "application/octet-stream"
333}

Callers 2

createObjectMethod · 0.80
TestGetContentTypeFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestGetContentTypeFunction · 0.64