web

package
v0.0.0-...-77d204d Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const Production = true

Production can be used to determain different aspects at compile time (like hot template reloading)

Variables

View Source
var (
	Assets    http.FileSystem
	Templates http.FileSystem
)

Functions

func LoadOrCreateCSRFSecret

func LoadOrCreateCSRFSecret(repo repo.Interface) ([]byte, error)

LoadOrCreateCSRFSecret either loads the bytes from $repo/web/csrf-secret or creates a new file with suitable keys in it

func LoadOrCreateCookieSecrets

func LoadOrCreateCookieSecrets(repo repo.Interface) ([]securecookie.Codec, error)

LoadOrCreateCookieSecrets either parses the bytes from $repo/web/cookie-secret or creates a new file with suitable keys in it

func TemplateFuncs

func TemplateFuncs(m *mux.Router, netInfo network.ServerEndpointDetails) template.FuncMap

TemplateFuncs returns a map of template functions

Types

type URLMaker

type URLMaker func(string, ...interface{}) *url.URL

func NewURLTo

func NewURLTo(appRouter *mux.Router, netInfo network.ServerEndpointDetails) URLMaker

NewURLTo returns a template helper function for a router. It is usually called with one parameter, the route name, which should be defined in the router package. If it's called with more then one, it has a to be a pair of two values. (1, 3, 5, 7, etc.) The first value of such a pair is the placeholder name in the router (i.e. in '/our/routes/{id:[0-9]+}/test' it would be id ) and the 2nd value is the actual value that should be put in place of the placeholder.

Directories

Path Synopsis
Package errors defines some well defined errors, like incomplete/wrong request data or object not found(404), for the purpose of internationalization.
Package errors defines some well defined errors, like incomplete/wrong request data or object not found(404), for the purpose of internationalization.
admin
Package admin implements the dashboard for admins and moderators to change and control aspects of the room.
Package admin implements the dashboard for admins and moderators to change and control aspects of the room.
Package i18n wraps around github.com/nicksnyder/go-i18n mostly so that we don't have to deal with i18n.LocalizeConfig struct literals everywhere.
Package i18n wraps around github.com/nicksnyder/go-i18n mostly so that we don't have to deal with i18n.LocalizeConfig struct literals everywhere.
Package members implements helpers for accessing the currently logged in admin or moderator of an active request.
Package members implements helpers for accessing the currently logged in admin or moderator of an active request.
Package webassert contains test helpers to the check the rooms web pages for certain aspects.
Package webassert contains test helpers to the check the rooms web pages for certain aspects.

Jump to

Keyboard shortcuts

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