token

package
v0.0.0-...-d817ec6 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Copyright 2019-2020 Axetroy. All rights reserved. Apache License 2.0.

Copyright 2019-2020 Axetroy. All rights reserved. Apache License 2.0.

Copyright 2019-2020 Axetroy. All rights reserved. Apache License 2.0.

Index

Constants

View Source
const (
	Prefix    = "Bearer"
	AuthField = "Authorization"
)

Variables

This section is empty.

Functions

func Generate

func Generate(secret, userId string) (tokenString string, err error)

generate jwt token

func JoinPrefixToken

func JoinPrefixToken(token string) string

Types

type Claims

type Claims struct {
	Uid string `json:"uid"`
	jwt.StandardClaims
}

func Parse

func Parse(secret, tokenString string) (claims Claims, err error)

parse jwt token

type ClaimsInternal

type ClaimsInternal struct {
	Uid string `json:"uid"` // base64 encode
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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