helpers

package
v0.0.0-...-e4e8516 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2016 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureInstaller

func ConfigureInstaller(fileIn string, fileOut string, group string) error

ConfigureInstaller configures an MSI with the required data

func CreateBrowserSession

func CreateBrowserSession(database *gorp.DbMap, r *http.Request, user models.User) (SessionID int64, SessionNonce []byte, err error)

CreateBrowserSession creates a browser session object and stores it in the DB

func GetIP

func GetIP(r *http.Request) []byte

GetIP finds the IP address of the request

func GetParam

func GetParam(urlValues url.Values, param string, regexMatcher string, defaultStr string) string

GetParam looks for a given parameter urlValues should be set to r.URL.Query() param is the name of the parameter regexMatcher is a regex string to ensure the string matches against, or "" for no regex

func Login

func Login(db *gorp.DbMap, email string, password string) (user *models.User, err error)

Login attempts to login with the provided credentials. On success, returns the user model, else nil and the error

func Parse

func Parse(t *template.Template, name string, data interface{}) string

Parse parses the template file

Types

type DatatableParams

type DatatableParams struct {
	Start      string
	Length     string
	SortColumn string
	SortOrder  string
}

DatatableParams sanitized parameters for SQL statements for returning info to datatables

func GetDatatableParams

func GetDatatableParams(urlValues url.Values, defaultSortColumn string) DatatableParams

GetDatatableParams given query parameters, it finds the values relevant to the datatable and sets the response struct with those values

Jump to

Keyboard shortcuts

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