Documentation ¶
Index ¶
- type CollegiateResultFormatter
- func (f CollegiateResultFormatter) ANSI(opts FormatterOptions) (string, error)
- func (f CollegiateResultFormatter) HTML(opts FormatterOptions) ([]byte, error)
- func (f CollegiateResultFormatter) JSON(opts FormatterOptions) ([]byte, error)
- func (f CollegiateResultFormatter) Plain(opts FormatterOptions) (string, error)
- type CollegiateResultsFormatter
- func (f CollegiateResultsFormatter) ANSI(opts FormatterOptions) (string, error)
- func (f CollegiateResultsFormatter) HTML(opts FormatterOptions) ([]byte, error)
- func (f CollegiateResultsFormatter) JSON(opts FormatterOptions) ([]byte, error)
- func (f CollegiateResultsFormatter) Plain(opts FormatterOptions) (string, error)
- type DefiningTextFormatter
- func (f DefiningTextFormatter) ANSI(opts FormatterOptions) (string, error)
- func (f DefiningTextFormatter) HTML(opts FormatterOptions) ([]byte, error)
- func (f DefiningTextFormatter) JSON(opts FormatterOptions) ([]byte, error)
- func (f DefiningTextFormatter) Plain(opts FormatterOptions) (string, error)
- type DefinitionsFormatter
- type Formatter
- type FormatterOptions
- type MWXMLChild
- type MWXMLNode
- type MerriamWebsterTagTextFormatter
- func (f MerriamWebsterTagTextFormatter) ANSI(opts FormatterOptions) (string, error)
- func (f MerriamWebsterTagTextFormatter) HTML(opts FormatterOptions) ([]byte, error)
- func (f MerriamWebsterTagTextFormatter) JSON(opts FormatterOptions) ([]byte, error)
- func (f MerriamWebsterTagTextFormatter) Plain(opts FormatterOptions) (string, error)
- type PronounciationsFormatter
- func (f PronounciationsFormatter) ANSI(opts FormatterOptions) (string, error)
- func (f PronounciationsFormatter) HTML(opts FormatterOptions) ([]byte, error)
- func (f PronounciationsFormatter) JSON(opts FormatterOptions) ([]byte, error)
- func (f PronounciationsFormatter) Plain(opts FormatterOptions) (string, error)
- type SenseFormatter
- type SenseSequenceFormatter
- func (f SenseSequenceFormatter) ANSI(opts FormatterOptions) (string, error)
- func (f SenseSequenceFormatter) HTML(opts FormatterOptions) ([]byte, error)
- func (f SenseSequenceFormatter) JSON(opts FormatterOptions) ([]byte, error)
- func (f SenseSequenceFormatter) Plain(opts FormatterOptions) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CollegiateResultFormatter ¶
type CollegiateResultFormatter types.CollegiateResult
CollegiateResultFormatter formats CollegiateResult
func (CollegiateResultFormatter) ANSI ¶
func (f CollegiateResultFormatter) ANSI(opts FormatterOptions) (string, error)
ANSI fills the Formatter interface to create ANSI CLI output
func (CollegiateResultFormatter) HTML ¶
func (f CollegiateResultFormatter) HTML(opts FormatterOptions) ([]byte, error)
HTML fills the Formatter interface to create HTML output
func (CollegiateResultFormatter) JSON ¶
func (f CollegiateResultFormatter) JSON(opts FormatterOptions) ([]byte, error)
JSON fills the Formatter interface to create JSON output
func (CollegiateResultFormatter) Plain ¶
func (f CollegiateResultFormatter) Plain(opts FormatterOptions) (string, error)
Plain fills the Formatter interface to create plaintext output
type CollegiateResultsFormatter ¶
type CollegiateResultsFormatter []types.CollegiateResult
CollegiateResultsFormatter formats []CollegiateResult
func (CollegiateResultsFormatter) ANSI ¶
func (f CollegiateResultsFormatter) ANSI(opts FormatterOptions) (string, error)
ANSI fills the Formatter interface to create ANSI CLI output
func (CollegiateResultsFormatter) HTML ¶
func (f CollegiateResultsFormatter) HTML(opts FormatterOptions) ([]byte, error)
HTML fills the Formatter interface to create HTML output
func (CollegiateResultsFormatter) JSON ¶
func (f CollegiateResultsFormatter) JSON(opts FormatterOptions) ([]byte, error)
JSON fills the Formatter interface to create JSON output
func (CollegiateResultsFormatter) Plain ¶
func (f CollegiateResultsFormatter) Plain(opts FormatterOptions) (string, error)
Plain fills the Formatter interface to create plaintext output
type DefiningTextFormatter ¶
type DefiningTextFormatter types.DefiningText
DefiningTextFormatter formats DefiningText
func (DefiningTextFormatter) ANSI ¶
func (f DefiningTextFormatter) ANSI(opts FormatterOptions) (string, error)
ANSI fills the Formatter interface to create ANSI CLI output
func (DefiningTextFormatter) HTML ¶
func (f DefiningTextFormatter) HTML(opts FormatterOptions) ([]byte, error)
HTML fills the Formatter interface to create HTML output
func (DefiningTextFormatter) JSON ¶
func (f DefiningTextFormatter) JSON(opts FormatterOptions) ([]byte, error)
JSON fills the Formatter interface to create JSON output
func (DefiningTextFormatter) Plain ¶
func (f DefiningTextFormatter) Plain(opts FormatterOptions) (string, error)
Plain fills the Formatter interface to create plaintext output
type DefinitionsFormatter ¶
type DefinitionsFormatter []types.Definition
DefinitionsFormatter formats []Definition
func (DefinitionsFormatter) ANSI ¶
func (f DefinitionsFormatter) ANSI(opts FormatterOptions) (string, error)
ANSI fills the Formatter interface to create ANSI CLI output
func (DefinitionsFormatter) HTML ¶
func (f DefinitionsFormatter) HTML(opts FormatterOptions) ([]byte, error)
HTML fills the Formatter interface to create HTML output
func (DefinitionsFormatter) JSON ¶
func (f DefinitionsFormatter) JSON(opts FormatterOptions) ([]byte, error)
JSON fills the Formatter interface to create JSON output
func (DefinitionsFormatter) Plain ¶
func (f DefinitionsFormatter) Plain(opts FormatterOptions) (string, error)
Plain fills the Formatter interface to create plaintext output
type Formatter ¶
type Formatter interface { ANSI(FormatterOptions) (string, error) Plain(FormatterOptions) (string, error) JSON(FormatterOptions) ([]byte, error) HTML(FormatterOptions) ([]byte, error) }
Formatter is an interface for abstracting fromatting for different elements
type FormatterOptions ¶
FormatterOptions stores and transfers state between formatters
func (FormatterOptions) WithAurora ¶
func (fo FormatterOptions) WithAurora(a aurora.Aurora) FormatterOptions
WithAurora copies the FormatterOptions but with the appropriate value
func (FormatterOptions) WithHomographs ¶
func (fo FormatterOptions) WithHomographs(h int) FormatterOptions
WithHomographs the FormatterOptions but with the appropriate value
func (FormatterOptions) WithPrefix ¶
func (fo FormatterOptions) WithPrefix(p string) FormatterOptions
WithPrefix copies the FormatterOptions but with the appropriate value
type MWXMLChild ¶
MWXMLChild contains either plain text or a child node in a MW text XML tree
type MWXMLNode ¶
type MWXMLNode struct { XMLName xml.Name Attrs []xml.Attr `xml:",attr"` Children []MWXMLChild }
MWXMLNode is a node of the XML tree of a parsed MW text
func (*MWXMLNode) UnmarshalXML ¶
UnmarshalXML is used to integrate with `encoding/xml`
type MerriamWebsterTagTextFormatter ¶
type MerriamWebsterTagTextFormatter string
MerriamWebsterTagTextFormatter formats text that contains MW tokens https://dictionaryapi.com/products/json#sec-2.tokens
func (MerriamWebsterTagTextFormatter) ANSI ¶
func (f MerriamWebsterTagTextFormatter) ANSI(opts FormatterOptions) (string, error)
ANSI fills the Formatter interface to create ANSI CLI output
func (MerriamWebsterTagTextFormatter) HTML ¶
func (f MerriamWebsterTagTextFormatter) HTML(opts FormatterOptions) ([]byte, error)
HTML fills the Formatter interface to create HTML output
func (MerriamWebsterTagTextFormatter) JSON ¶
func (f MerriamWebsterTagTextFormatter) JSON(opts FormatterOptions) ([]byte, error)
JSON fills the Formatter interface to create JSON output
func (MerriamWebsterTagTextFormatter) Plain ¶
func (f MerriamWebsterTagTextFormatter) Plain(opts FormatterOptions) (string, error)
Plain fills the Formatter interface to create plaintext output
type PronounciationsFormatter ¶
type PronounciationsFormatter []types.Pronounciation
PronounciationsFormatter formats []Pronounciation
func (PronounciationsFormatter) ANSI ¶
func (f PronounciationsFormatter) ANSI(opts FormatterOptions) (string, error)
ANSI fills the Formatter interface to create ANSI CLI output
func (PronounciationsFormatter) HTML ¶
func (f PronounciationsFormatter) HTML(opts FormatterOptions) ([]byte, error)
HTML fills the Formatter interface to create HTML output
func (PronounciationsFormatter) JSON ¶
func (f PronounciationsFormatter) JSON(opts FormatterOptions) ([]byte, error)
JSON fills the Formatter interface to create JSON output
func (PronounciationsFormatter) Plain ¶
func (f PronounciationsFormatter) Plain(opts FormatterOptions) (string, error)
Plain fills the Formatter interface to create plaintext output
type SenseFormatter ¶
SenseFormatter formats a sense
func (SenseFormatter) ANSI ¶
func (f SenseFormatter) ANSI(opts FormatterOptions) (string, error)
ANSI fills the Formatter interface to create ANSI CLI output
func (SenseFormatter) HTML ¶
func (f SenseFormatter) HTML(opts FormatterOptions) ([]byte, error)
HTML fills the Formatter interface to create HTML output
func (SenseFormatter) JSON ¶
func (f SenseFormatter) JSON(opts FormatterOptions) ([]byte, error)
JSON fills the Formatter interface to create JSON output
func (SenseFormatter) Plain ¶
func (f SenseFormatter) Plain(opts FormatterOptions) (string, error)
Plain fills the Formatter interface to create plaintext output
type SenseSequenceFormatter ¶
type SenseSequenceFormatter types.SenseSequence
SenseSequenceFormatter formats a SenseSequence
func (SenseSequenceFormatter) ANSI ¶
func (f SenseSequenceFormatter) ANSI(opts FormatterOptions) (string, error)
ANSI fills the Formatter interface to create ANSI CLI output
func (SenseSequenceFormatter) HTML ¶
func (f SenseSequenceFormatter) HTML(opts FormatterOptions) ([]byte, error)
HTML fills the Formatter interface to create HTML output
func (SenseSequenceFormatter) JSON ¶
func (f SenseSequenceFormatter) JSON(opts FormatterOptions) ([]byte, error)
JSON fills the Formatter interface to create JSON output
func (SenseSequenceFormatter) Plain ¶
func (f SenseSequenceFormatter) Plain(opts FormatterOptions) (string, error)
Plain fills the Formatter interface to create plaintext output