controllerSharedFuncs

package
v0.0.0-...-659eabc Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2017 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToHexString

func ConvertToHexString(source string) string

ConvertToHexString converts a string to a SHA512 Representation string.

func EnableDisableGameForUser

func EnableDisableGameForUser(userID int64, gameID int64, enable bool) (bool, error)

EnableDisableGameForUser makes an action on the specified game for the user, if valid.

returns if the cache has been updated and the error if present.

func GenerateToken

func GenerateToken() string

generateToken creates a valid session token.

func GetIDFromSessionSet

func GetIDFromSessionSet(SessionSet string, Token string) (int64, error)

GetIDFromSessionSet gets a generic ID of an entity from its set in cache and session token.

func IsValidAPI_Token

func IsValidAPI_Token(token string) (bool, error)

IsValidAPI_Token Provides a control for forged requests with fake API_Tokens

Returns true if the token is valid, false otherwise.

func UpdateCacheNewSession

func UpdateCacheNewSession(SessionSet string, expiration time.Duration, ID int64, values ...interface{}) (string, error)

UpdateCacheNewSession Updates the cache SessionSet with the email and the expiration.

ID represents the ID of the entity to put values represents additional data to create hashmaps, they must be in the form ["key1", "value1", "key2", "value2", ..., and so on]; can be empty.

func UpdateCacheWithAPI_Token

func UpdateCacheWithAPI_Token(token string) error

UpdateCacheWithAPI_Token updates the Cache with the specified API_Token.

Return error if did not manage to update the cache.

Types

This section is empty.

Directories

Path Synopsis
Package isCacheConsistent contains variables to check whenever cache is not consistent with the archives (so it should not be used and must be fixed from a routine).
Package isCacheConsistent contains variables to check whenever cache is not consistent with the archives (so it should not be used and must be fixed from a routine).

Jump to

Keyboard shortcuts

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