controllerhelpers

package
v0.0.0-...-906974d Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2015 License: GPL-3.0, GPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthFilter

func AuthFilter(socketid string, f func(string) string) func(string) string

func AuthenticateSocket

func AuthenticateSocket(socketid string, r *http.Request) error

func BuildFailureJSON

func BuildFailureJSON(message string, code int) *simplejson.Json

func BuildMissingArgJSON

func BuildMissingArgJSON(arg string) *simplejson.Json

func BuildSuccessJSON

func BuildSuccessJSON(data *simplejson.Json) *simplejson.Json

func DeauthenticateSocket

func DeauthenticateSocket(socketid string)

func FormatClassMap

func FormatClassMap(format models.LobbyType) map[string]int

func GetPlayerSlot

func GetPlayerSlot(lobbytype models.LobbyType, teamStr string, classStr string) (int, *helpers.TPError)

func GetSessionHTTP

func GetSessionHTTP(r *http.Request) (*sessions.Session, error)

func GetSessionSocket

func GetSessionSocket(socketid string) (*sessions.Session, error)

func GetSteamId

func GetSteamId(socketid string) string

func IsLoggedInHTTP

func IsLoggedInHTTP(r *http.Request) bool

func IsLoggedInSocket

func IsLoggedInSocket(socketid string) bool

func JsonParamFilter

func JsonParamFilter(f func(*simplejson.Json) string) func(string) string

func JsonVerifiedFilter

func JsonVerifiedFilter(p map[string]Param, f func(*simplejson.Json) string) func(string) string

func RedirectHome

func RedirectHome(w http.ResponseWriter, r *http.Request)

func SendJSON

func SendJSON(w http.ResponseWriter, json *simplejson.Json)

Types

type Param

type Param struct {
	Type    ParamType
	Default interface{}
}

type ParamType

type ParamType int
const (
	PTypeInt    ParamType = iota
	PTypeString ParamType = iota
	PTypeBool   ParamType = iota
	PTypeFloat  ParamType = iota
)

Jump to

Keyboard shortcuts

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