...
Package ianaindex
Overview ▹
Index ▹
type Index ¶
Index maps names registered by IANA to Encodings. Currently different Indexes only differ in the names they return for encodings. In the future they may also differ in supported aliases.
type Index struct {
// contains filtered or unexported fields
}
var ( // MIME is an index to map MIME names. MIME *Index = mime // IANA is an index that supports all names and aliases using IANA names as // the canonical identifier. IANA *Index = iana // MIB is an index that associates the MIB display name with an Encoding. MIB *Index = mib )
▹ Example
func (*Index) Encoding ¶
func (x *Index) Encoding(name string) (encoding.Encoding, error)
Encoding returns an Encoding for IANA-registered names. Matching is case-insensitive.
func (*Index) Name ¶
func (x *Index) Name(e encoding.Encoding) (string, error)
Name reports the canonical name of the given Encoding. It will return an error if the e is not associated with a known encoding scheme.