Documentation ¶
Index ¶
- Variables
- func GetField(config interface{}, key string, value string) string
- func GetLink(routeName string, fields ...string) string
- func GetRouter(newInstance ...bool) *mux.Router
- func GetStaticURL(contentType string, pathNames ...string) string
- func GraphQLGetSession(params graphql.ResolveParams) *sessions.Session
- func GraphQLSetSession(params graphql.ResolveParams, ...)
- func GzipString(content string) ([]byte, error)
- func Intify(data interface{}) int
- func Log(name string, variable interface{})
- func ParseAllTemplates() *template.Template
- func Stringify(data interface{}) string
Constants ¶
This section is empty.
Variables ¶
var SessionStore = sessions.NewCookieStore([]byte(sessionSecret))
SessionStore - Session
var TemplateHelpers template.FuncMap
TemplateHelpers - Template helper functions
Functions ¶
func GetField ¶
GetField - Get field and apply the default value(if any)
params -- config {interface{}} The structure -- key {string} The field with the default set -- value {string} The value of that field
returns -- {string} The real value
func GetLink ¶
GetLink - Template helper function to get named router links
params -- routeName {string} Router name to craft the link for -- fields {...string} A flat map of all fields and values to pass to the router
returns -- {string} The url
func GetRouter ¶
GetRouter - Get a router instance (singleton)
params -- newInstance {bool} Optional parameter to force a new instance
returns -- {*mux.Router} Router instance
func GetStaticURL ¶
GetStaticURL - Get the link to the public directory
params -- routeName {string} Router name to craft the link for -- fields {...string} A flat map of all fields and values to pass to the router
returns -- {string} The url
func GraphQLGetSession ¶
func GraphQLGetSession(params graphql.ResolveParams) *sessions.Session
GraphQLGetSession -
func GraphQLSetSession ¶
func GraphQLSetSession(params graphql.ResolveParams, callback func(*sessions.Session) *sessions.Session)
GraphQLSetSession -
func GzipString ¶
GzipString - Compress a string with gzip
params -- content {string} The string to compress
returns -- {[]bytes} Compressed data -- {error}
Types ¶
This section is empty.