Documentation ¶
Index ¶
- Constants
- func DelTokeStrng(tokenString string) error
- func DelTokenCtx(ctx context.Context, app, device, id string) error
- func GenToken(id, app, name, kind, username, device string, duration time.Duration) (string, error)
- func GetClient(r *http.Request) et.Json
- 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 DelTokeStrng ¶ added in v0.0.34
* * DelTokeStrng * @param tokenString string * @return error *
func DelTokenCtx ¶
* * DelTokenCtx * @param ctx context.Context * @param app string * @param device string * @param id string * @return error *
func GenToken ¶
* * GetToken * @param id string * @param app string * @param name string * @param kind string * @param username string * @param device string * @param duration time.Duration * @return string * @return 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 ctx context.Context * @param tokenString string * @return *Claim * @return error *
func ParceToken ¶
* * ParceToken * @param tokenString string * @return *Claim * @return error *
Click to show internal directories.
Click to hide internal directories.