Documentation ¶
Index ¶
- Constants
- func DeleteTokeByToken(token string) error
- func DeleteToken(app, device, id string) error
- func GetClient(r *http.Request) et.Json
- func NewToken(id, app, name, kind, username, device string, duration time.Duration) (string, error)
- func SetToken(app, device, id, token string) error
- func TokenKey(app, device, id string) string
- type Claim
Constants ¶
View Source
const ( MSG_TOKEN_INVALID = "Token invalido" MSG_TOKEN_INVALID_ATRIB = "Token invalido, atrib (%s)" MSG_REQUIRED_INVALID = "Solicitud invalida" ERR_INVALID_CLAIM = "Formato token invalido" )
Variables ¶
This section is empty.
Functions ¶
func DeleteTokeByToken ¶ added in v1.0.12
* * DeleteTokeByToken * @param token string * @return error *
func DeleteToken ¶ added in v1.0.8
* * DeleteToken * @param app string * @param device string * @param id string * @return error *
func NewToken ¶ added in v1.0.8
* * NewToken * @param id string * @param app string * @param name string * @param kind string * @param username string * @param device string * @param duration time.Duration * @return token string * @return key string * @return err error *
Types ¶
type Claim ¶
type Claim struct { ID string `json:"id"` App string `json:"app"` Name string `json:"name"` Kind string `json:"kind"` Username string `json:"username"` Device string `json:"device"` Duration time.Duration `json:"duration"` jwt.StandardClaims }
func GetFromToken ¶
* * GetFromToken * @param token string * @return *Claim * @return error *
func ParceToken ¶
* * ParceToken * @param token string * @return *Claim * @return error *
Click to show internal directories.
Click to hide internal directories.