Documentation
¶
Overview ¶
Package ui provides functions for rendering styled terminal output, including headings, section markers, formatted currency, record counters, and application links.
Index ¶
- Constants
- func RenderApplicationLink(entity, slug string) string
- func RenderFeatureAccessMessage(featureName, contactURL string)
- func RenderHeading(heading string) string
- func RenderHighlightedText(text string) string
- func RenderMoney(amount float64, currencyCode string) string
- func RenderRecordCounter(count, total int) string
- func RenderSectionMarker() string
Constants ¶
const AppDateTimeFormat string = "02-01-2006 15:04"
AppDateTimeFormat The format for date/times in the application.
const (
// DarkGrey is the colour for Grey
DarkGrey = "#989898"
)
Variables ¶
This section is empty.
Functions ¶
func RenderApplicationLink ¶
RenderApplicationLink will standardise the way we render application links.
func RenderFeatureAccessMessage ¶ added in v0.0.58
func RenderFeatureAccessMessage(featureName, contactURL string)
RenderFeatureAccessMessage renders a styled early-access feature message to stderr. This is used when a feature is gated behind a feature flag and returns 404 feature not enabled errors. Output goes to stderr so it doesn't interfere with JSON/CSV output piping.
func RenderHeading ¶
RenderHeading will render a heading in the output.
func RenderHighlightedText ¶ added in v0.0.57
func RenderMoney ¶
RenderMoney will return a symbolised string of money, e.g. £10.00
func RenderRecordCounter ¶
RenderRecordCounter will render a common string to explain how many records are being shown out of the total collection. This will take care of pluralisation for you.
func RenderSectionMarker ¶
func RenderSectionMarker() string
RenderSectionMarker will render a section marker in the output.
Types ¶
This section is empty.