claim

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

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

func DelTokeStrng(tokenString string) error

* * DelTokeStrng * @param tokenString string * @return error *

func DelTokenCtx

func DelTokenCtx(ctx context.Context, app, device, id string) error

* * DelTokenCtx * @param ctx context.Context * @param app string * @param device string * @param id string * @return error *

func GenToken

func GenToken(id, app, name, kind, username, device string, duration time.Duration) (string, error)

* * 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 *

func GetClient

func GetClient(r *http.Request) et.Json

* * GetClient * @param r *http.Request * @return et.Json *

func SetToken added in v0.0.172

func SetToken(app, device, id, token string) error

* * SetToken * @param app string * @param device string * @param id string * @param token string * @return error *

func TokenKey

func TokenKey(app, device, id string) string

* * TokenKey * @param app string * @param device string * @param id string * @return string *

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

func GetFromToken(ctx context.Context, tokenString string) (*Claim, error)

* * GetFromToken * @param ctx context.Context * @param tokenString string * @return *Claim * @return error *

func ParceToken

func ParceToken(tokenString string) (*Claim, error)

* * ParceToken * @param tokenString string * @return *Claim * @return error *

Jump to

Keyboard shortcuts

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