Categorygithub.com/bjbigler/render
modulepackage
0.0.0-20240627192012-2bdac9fbb7af
Repository: https://github.com/bjbigler/render.git
Documentation: pkg.go.dev

# Functions

Add ...
ArrayToQS takes a key and string array and produces &key=v&key=v, etc.
StringToBrowser takes *html* string and sends it to the browser.
CalcTabIndex ...
GenericBytesToBrowser streams a file without setting its content type.
CsvToBrowser takes a [][]string and sends it to the browser as a CSV file.
Dashes returns dashes related to the level, e.g., level 1 = zero dashes, level 2 = two dashes, etc.
DateDay (2).
DateFormatDisplay (January 2006).
DateMonth (Jan).
DateTimeFormal (January 2, 2006 at 3:04PM).
DateYear (2006).
DecimalDisplay0 ...
DecimalDisplay2 ...
DecimalDisplay3 ...
DictHelper ...
DisplayDate (01/02/2006).
DisplayDateTime (01/02/2006 03:04PM).
DisplayMorningAfternoonEvening returns "Morning" when time.Hour is less than 12; "Afternoon" when time.Hour is less than 18 (before 6PM) "Evening" for all other times.
Divide ...
FindAndParseTemplates parses all templates.
FirstInitial returns first initial of name.
Float64Display0 formats a float64 with precision 4 to 3 decimals.
Float64Display2 formatsa float64 with precision 4 to 3 decimals.
Float64Display3 formats a float64 with precision 4 to 3 decimals.
Format2 returns a number with two decimal points.
FormatDate ...
FormatDateUTC ...
FormatPhone ...
FullDateFormat ...
FullDateTimeET returns Eastern Time representation (2006-01-02 15:04).
FullDisplayDate in NY.
GenericBytesToBrowser streams a file without setting its content type.
GetFuncMap provides a set of utility functions to help format data on an HTML output page.
HTMLEscape ...
No description provided by the author
No description provided by the author
Int64Display0 formats an integer with precision 4 to 0 decimals.
Int64Display2 formats an integer with precision 4 to 2 decimals.
Int64Display2FromPrecision10 ...
Int64Display3 formats an integer with precision 4 to 3 decimals.
Int64ToTime returns an HTML-time-formatted string from an int64.
IntDisplay0 formats an integer with precision 0.
IntlDateDisplay (2006-01-02).
IssueDateFormatDisplay ...
IsToday ...
JSONToBrowser sends a JSON []byte to the browser.
KeyToStringID ...
Marshal ...
Multiply ...
NewLineToBR ...
ParseTemplateSets parses sets of files into templates, one per page needed.
PDFBytesToBrowser streams PDF file to browser.
PDFToBrowser streams PDF file to browser.
PlusOne adds one to the value provided.
PlusOne64 adds one to the value provided.
PlusOneZeroPad adds one to the value provided and pads with a zero.
PrecisionFormatter formats value to precision decimal places.
No description provided by the author
PrepPhone replaces ")", "(", "-", " " to make sure it will show up in a "tel" tag with proper format.
RedirectTo ...
RenderSnippet utilizes GO's templating engine to render a template fragment into a string using *models*'s data.
ReportError sends JSON message with "statusCode:0" and "error:" with the error specified.
ReportErrors sends JSON message with "statusCode:0" and the errors specified.
ReportJSON json.Marshals *results* and returns an error if that fails.
ReportMessage sends JSON messagae with "statusCode:0" and "msg:" *message.
ReportRedirect sends JSON message with "statusCode" of 1 "redirect" equal to the *redirect* provided.
ReportReload sends JSON message with "statusCode:5", which doGetFetch/doPostFetch interpret as a reload.
ReportSuccess sends JSON message with "statusCode:1".
ShortDateTime returns Eastern Time representation (Jan 01 15:04).
StringToBrowser takes *html* string and sends it to the browser.
Subtract ...
Template renders template from the template map produced by ParseTemplateSets.
TimeFormat returns AM/PM time format.
TimeFormatAmPm ...
ToBrowser pairs master.html template to whatever instanceTemplate gets passed in.
ToBrowserNoMaster prints out template with no master.
ToBrowserNoMasterNew ...
ToBytesFromString renders a string HTML template.
ToHTML renders a template as template.HTML to use as html fragments when compositing a page together.
ToHTMLOld renders a template as template.HTML to use as html fragments when compositing a page together.
ToLowercase ...
ToString renders the instanceTemplate alone, without any master supplied.
ToStringFromString renders a string HTML template.
ToTitleCase ...
ToUppercase ...
URLSafeKey returns URL-safe representation of key.
WhenCompletedDisplay ...
WhenRevisedDisplay ...
WriteIcsToBrowser delivers iCalendar files to the browser.
WriteXlsToBrowser takes a string formatted as Office XML and outputs it to the browswer as a file.
No description provided by the author
ZeroPad adds a zero in front of the value.
ZeroPad64 adds a zero in front of the value.