Documentation
¶
Index ¶
Constants ¶
View Source
const VERSION = "0.0.1"
Variables ¶
View Source
var ( CookieName string // the name of the cookie that will be used, default: "token" ConfigPath string // path to config file, default: "" ConfigType string // type of config file, default: "ini" Prefix string // the key in ctx.Keys[] to use, default: "" HashKey []byte // hash key for securecookie BlockKey []byte // block key for securecookie Expiration int64 // time until the cookie expires in seconds, default: 604800 Authorized func(ctx *gin.Context) // function called if user is authorized SecureCookie *securecookie.SecureCookie // global secure cookie object )
set our global package variables
Functions ¶
func Check ¶
checks for our token cookie, decodes it, and determines if it is valid the encrypted cookie data set in Login() will be set to the current context as well
func LoadConfig ¶
func LoadConfig() error
this function loads your specified configuration file and it's values
func Login ¶
handles the login process the first param is a map of strings that will be added to the cookie data before encryption and will be able to be recovered when Check() is called
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.