claim

package
v0.0.146 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 12 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"
)

Variables

This section is empty.

Functions

func DelTokeStrng added in v0.0.34

func DelTokeStrng(tokenString string) error

func DelTokenCtx

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

func GenToken

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

func GenTokenCtx

func GenTokenCtx(ctx context.Context, id, app, name, kind, username, device string, duration time.Duration) (string, error)

func GetClient

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

func TokenKey

func TokenKey(app, device, id string) 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)

func ParceToken

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

Jump to

Keyboard shortcuts

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