Documentation
¶
Index ¶
- Constants
- func CharsetOf(str string) string
- func ParamOf(str, key string) string
- func ParamOfOr(str, key, or string) string
- func QualityOf(str string) int
- func ValueOf(str string) string
- type Headers
- func (h *Headers) Add(key string, newValues ...string)
- func (h *Headers) Clear()
- func (h *Headers) Has(key string) bool
- func (h *Headers) KeysIter() Iterator[string]
- func (h *Headers) Unwrap() []string
- func (h *Headers) Value(key string) string
- func (h *Headers) ValueOr(key, or string) string
- func (h *Headers) Values(key string) (values []string)
- func (h *Headers) ValuesIter(key string) Iterator[string]
- type Iterator
- type TransferEncoding
Constants ¶
const DefaultEncoding = "iso-8859-1"
Variables ¶
This section is empty.
Functions ¶
func CharsetOf ¶
CharsetOf returns a charset parameter value, returning DefaultEncoding in case not presented
func ParamOf ¶
ParamOf is an alias to ParamOfOr, except no `or`-parameter is passed - empty string will be returned in case not found.
func ParamOfOr ¶
ParamOfOr looks for a parameter in a value, and if found, returns a parameter value. In case parameter is not found, `or` is returned
Types ¶
type Headers ¶
type Headers struct {
// contains filtered or unexported fields
}
Headers is a struct that encapsulates headers map from user, allowing only methods
func NewHeaders ¶
func (*Headers) Clear ¶
func (h *Headers) Clear()
Clear headers map. Is a system method, that is not supposed to be ever called by user
func (*Headers) Unwrap ¶
Unwrap returns an underlying map as it is. This means that modifying it will also affect Headers object
func (*Headers) Value ¶
Value does the same as ValueOr does but returning an empty string by default