2024-01-03 20:39:39 +03:00
|
|
|
package contents
|
|
|
|
|
2024-01-10 18:23:02 +03:00
|
|
|
import (
|
|
|
|
)
|
2024-01-03 20:39:39 +03:00
|
|
|
|
2024-01-10 18:23:02 +03:00
|
|
|
type CharSet string
|
|
|
|
const (
|
|
|
|
Utf8 = "utf-8"
|
|
|
|
)
|
2024-01-03 20:39:39 +03:00
|
|
|
|
2024-01-10 18:23:02 +03:00
|
|
|
type Type string
|
2024-01-03 20:39:39 +03:00
|
|
|
const (
|
|
|
|
// Using the UTF-8 by default.
|
|
|
|
Unknown Type = "application/octet-stream"
|
2024-01-10 18:23:02 +03:00
|
|
|
Binary
|
2024-01-10 20:11:02 +03:00
|
|
|
Plain Type = "text/plain"
|
2024-01-03 20:39:39 +03:00
|
|
|
Css Type = "text/css"
|
|
|
|
Html Type = "text/html"
|
|
|
|
Json Type = "application/json"
|
2024-01-10 18:23:02 +03:00
|
|
|
UrlEncoded = "application/x-www-form-urlencoded"
|
2024-01-03 20:39:39 +03:00
|
|
|
)
|
2024-01-10 18:23:02 +03:00
|
|
|
|
|
|
|
func (t Type) CharSet(set CharSet) Type {
|
|
|
|
return t + ";" + Type(set)
|
|
|
|
}
|