Updates package comments
This commit is contained in:
parent
23f01a7290
commit
27261a6f6c
17
mailcap.go
17
mailcap.go
|
@ -1,3 +1,7 @@
|
|||
// Package mailcap is a port of the python3 mailcap library to golang and
|
||||
// provides developers with the ability to query mimetypes and keys against
|
||||
// the various mailcap files on a system to acquire an appropriate command
|
||||
// to run in order to view, edit, etc a given file of a given mimetype.
|
||||
package mailcap
|
||||
|
||||
import (
|
||||
|
@ -10,9 +14,22 @@ import (
|
|||
"sort"
|
||||
)
|
||||
|
||||
// Entry is a map of strings keyed with strings that represents a single
|
||||
// mailcap entry. It represents one prgram for one mimetype. An entry can
|
||||
// contain options for various keys (test, view, edit, etc).
|
||||
type Entry map[string]string
|
||||
|
||||
// Fields is a slice of entries that gets used as a part of the Cap type
|
||||
type Fields []Entry
|
||||
|
||||
// Cap is a map of Fields (itself a slice of Entries) and represents
|
||||
// each mimetype and a slice of the various entries (programs) available
|
||||
// for that mimetype.
|
||||
type Cap map[string]Fields
|
||||
|
||||
// Mailcap is the main struct to interact with. It contains a Cap, as
|
||||
// caps, that represents the full mailcap db for the system. It has a
|
||||
// number of receivers to facilitate retrieving a command from a mimetype.
|
||||
type Mailcap struct {
|
||||
Caps Cap
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue