libs

package
v0.0.0-...-9090d56 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SessionStore = sessions.NewCookieStore([]byte(sessionSecret))

SessionStore - Session

View Source
var TemplateHelpers template.FuncMap

TemplateHelpers - Template helper functions

Functions

func GetField

func GetField(config interface{}, key string, value string) string

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(routeName string, fields ...string) string

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

func GetRouter(newInstance ...bool) *mux.Router

GetRouter - Get a router instance (singleton)

params -- newInstance {bool} Optional parameter to force a new instance

returns -- {*mux.Router} Router instance

func GetStaticURL

func GetStaticURL(contentType string, pathNames ...string) string

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

func GzipString(content string) ([]byte, error)

GzipString - Compress a string with gzip

params -- content {string} The string to compress

returns -- {[]bytes} Compressed data -- {error}

func Intify

func Intify(data interface{}) int

Intify -

func Log

func Log(name string, variable interface{})

Log stuff to console

func ParseAllTemplates

func ParseAllTemplates() *template.Template

ParseAllTemplates - Parses all templates

returns -- {*template.Template}

func Stringify

func Stringify(data interface{}) string

Stringify -

Types

This section is empty.

Jump to

Keyboard shortcuts

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