jwttoken

package
Version: v0.0.0-...-9e745d5 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2020 License: Apache-2.0 Imports: 5 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUser

func GetUser(t string) string

GetUser - func to parse token and check to valid

func GetUserProjects

func GetUserProjects(t string) []string

GetUserProjects - func to parse token and check to valid

func IsAdmin

func IsAdmin(t string) bool

IsAdmin - func to parse token and check to valid

func Parse

func Parse(t string) bool

Parse - func to parse token and check to valid

Types

type Token

type Token struct {
	Token string `json:"token"`
}

Token - struct for token

func (Token) Check

func (t Token) Check() bool

Check - func for check validate JWT, result bool

func (Token) Generate

func (t Token) Generate(role string, user string, projects []string) (tokenstring string, err error)

Generate - genereta default jwt

func (Token) GenerateTemp

func (t Token) GenerateTemp(role string, user string, projects []string) (tokenstring string, err error)

GenerateTemp - genereta default jwt

func (Token) New

func (t Token) New() subset.Token

Source Files

Jump to

Keyboard shortcuts

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