config

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
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

View Source
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

View Source
var DefaultDateFormat = "January 2, 2006"
View Source
var DefaultDateTimeFormat = "January 2, 2006 3:04am"
View Source
var DefaultTimeFormat = "3:04 am"
View Source
var Minify bool = !Debug

Minify controls whether we try to strip out unnecessary whitespace from our HTML output

View Source
var Port int = 8000
View Source
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.

View Source
var TLSKeyFile = ""
View Source
var TLSPort int = 0 // This will require ssl certificates. The default has this turned off.
View Source
var UseFCGI bool
View Source
var WebSocketPort int = 8101 // Default can be reset later, or via command line, but before the application starts. Set to zero to turn it off.
View Source
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.

View Source
var WebSocketTLSKeyFile = ""
View Source
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

type Sanitizer

type Sanitizer interface {
	Sanitize(string) string
}

Sanitizer describes an object that can sanitize user input

var GlobalSanitizer Sanitizer

GlobalSanitizer is used by textboxes to sanitize user input before it is stored

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL