Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var UT = UserTokens{Token: make(map[string][]byte)}
UT is a user's token methods
Functions ¶
func EncodePayload ¶
EncodePayload encodes the token payload using gob
func GenerateToken ¶
GenerateToken generate a new timaan token which can be used mostly after successful authentication process, mostly use after successful login, this can also be used as you sessions for the entire duration of the token validity period.
func RandomToken ¶ added in v1.0.1
func RandomToken() string
RandomToken uses the lower-case letters from 'a' to 'z' and positive numeric digits combination
Types ¶
type TK ¶
TK is a successful auth token requests after successful login the TokenKey might be anything, e.g username, random unique alpha-numeric strings, etc.
func DecodePayload ¶ added in v1.0.1
DecodePayload extracts the token payload
type TP ¶
type TP map[string]interface{}
TP type stands for 'Token Payload' that uses the map[string]interface{} as the custom token payload structure
type UserTokens ¶
UserTokens is a users auth token requests stored in memory
func (*UserTokens) Add ¶
func (t *UserTokens) Add(tokenKey string, encBytes []byte)
Add insert the new token request to the 'UserTokens' map
The timaan package is a token generator for your user's authentication process in your app whether it's a WEB, CLI, or Mobile applications.