Updates package comments

This commit is contained in:
sloumdrone 2019-07-03 14:39:38 -07:00
parent 23f01a7290
commit 27261a6f6c
1 changed files with 17 additions and 0 deletions

View File

@ -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
}