atom/atom.go

23 lines
364 B
Go
Raw Normal View History

2024-10-13 17:19:40 +02:00
package atomfeed
import (
"mime"
"strings"
)
2024-10-15 19:40:13 +02:00
2024-10-13 17:19:40 +02:00
type (
EmailAddress string
LanguageTag string
MediaType string
URI string
)
2024-10-15 19:40:13 +02:00
func isXMLMediaType(mediaType string) bool {
mediaType, _, err := mime.ParseMediaType(mediaType)
if err != nil {
return false
}
2024-10-15 19:40:13 +02:00
return strings.HasSuffix(mediaType, "/xml") || strings.HasSuffix(mediaType, "+xml")
}