Documentation ¶
Index ¶
- Constants
- Variables
- func AssetDirectory() string
- func GoraddAssets() string
- func GoraddDir() string
- func HtmlDirectory() string
- func ProjectAssets() string
- func ProjectDir() string
- func SetAssetDirectory(assetDir string)
- func SetHtmlDirectory(d string)
- func SetProjectDir(path string)
- type BlueMondaySanitizer
- type Sanitizer
Constants ¶
const Debug = true
The Debug constant is used throughout the framework to turn on or off various debugging features. It is on by default. To turn it off, build with the -tags "nodebug" flag
const Release = false
The Release constant is used throughout the framework to determine if we are running the development version or release version of the product. The development version is designed to make on-going development easier, and the release version is designed to run on a deployment server. It is off by default, but you can turn it on by building with the -tags "release" flag. Combine with the nodebug tag like so: go build -tags "release nodebug" You might build a release version that keeps the debug features on if you are building for manual testers
Variables ¶
var ApiPrefix = "/api/"
var AssetPrefix = "/assets/"
AssetPrefix is the path prefix for all goradd assets. It indicates to the program to look for the given file in the assets collection of files which in development mode is wherever the file is on the disk, and in release mode, the central asset directory where all assets get copied
var DefaultDateFormat = "January 2, 2006"
var DefaultDateTimeFormat = "January 2, 2006 3:04am"
var DefaultTimeFormat = "3:04 am"
var Minify bool = !Debug
Minify controls whether we try to strip out unnecessary whitespace from our HTML output
var NoSelectionString = "-"
NoSelectionString is used in selection lists as the item that indicates no selection when a selection is not required
var Port int = 8000
var SelectOneString = "- Select One -"
SelectOneString is used in selection lists as the default item to indicate that a selection is required but has not yet been made
var TLSCertFile = ""
You will need to put in the path to your certfile and keyfile below. The default implementation only uses these for the release build.
var TLSKeyFile = ""
var TLSPort int = 0 // This will require ssl certificates. The default has this turned off.
var UseFCGI bool
var WebSocketPort int = 8100 // Default can be reset later, or via command line, but before the application starts. Set to zero to turn it off.
var WebSocketTLSCertFile = ""
You will need to put in the path to your certfile and keyfile below. The default implementation only uses these for the release build. You can use the same ones that you use for normal SSL communication over http.
var WebSocketTLSKeyFile = ""
var WebSocketTLSPort int = 0 // This will require ssl certificates. The default has this turned off.
Functions ¶
func AssetDirectory ¶
func AssetDirectory() string
func GoraddAssets ¶
func GoraddAssets() string
GoraddAssets returns the disk location of the assets directory.
func HtmlDirectory ¶
func HtmlDirectory() string
func ProjectAssets ¶
func ProjectAssets() string
func ProjectDir ¶
func ProjectDir() string
func SetAssetDirectory ¶
func SetAssetDirectory(assetDir string)
func SetHtmlDirectory ¶
func SetHtmlDirectory(d string)
func SetProjectDir ¶
func SetProjectDir(path string)
Types ¶
type BlueMondaySanitizer ¶
type BlueMondaySanitizer struct {
// contains filtered or unexported fields
}
BlueMondaySanitizer is a sanitizer based on microcosm-cc/bluemonday. BlueMonday is designed to sanitize input coming from a WYSIWYG HTML editor, so it has the annoying extra step of escaping HTML entities. We wrap the BlueMonday sanitizer in this structure so that we can unescape html entities before sending them to the textbox. We will still get all the stripping of javascript that the sanitizer normally does. If you want a different global sanitizer, change it here. Or, override the Sanitize function in the textbox object.
This sanitizer is no longer used by default, because it removes too much valid text. For example, a<b is changed. So, you need to be careful to escape anything you are outputting to the browser instead.
func (BlueMondaySanitizer) Sanitize ¶
func (s BlueMondaySanitizer) Sanitize(in string) string