From 27261a6f6cbd5d006dac0e01a3131caae0614a1d Mon Sep 17 00:00:00 2001 From: sloumdrone Date: Wed, 3 Jul 2019 14:39:38 -0700 Subject: [PATCH] Updates package comments --- mailcap.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/mailcap.go b/mailcap.go index a219217..44fc769 100644 --- a/mailcap.go +++ b/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 }