Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
UserKey = "user-ctx"
)
Functions ¶
func GenerateToken ¶
func GenerateToken(claims CustomClaims) (string, error)
Types ¶
type CustomClaims ¶
type CustomClaims struct {
jwt.RegisteredClaims
Name string `json:"name,omitempty"`
}
func ClaimJWT ¶
func ClaimJWT(bearerToken string) (*CustomClaims, error)
func GetUserContext ¶
func GetUserContext(ctx context.Context) *CustomClaims
Click to show internal directories.
Click to hide internal directories.