auth

package
v0.0.0-...-b743a0b Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth interface {
	Decode(token string) (*CustomClaims, error)
	Encode(user *pb.User) (string, error)
}

func New

func New(key string) *Auth

type CustomClaims

type CustomClaims struct {
	User *pb.User
	jwt.StandardClaims
}

type TokenService

type TokenService struct {
	// contains filtered or unexported fields
}

func (*TokenService) Decode

func (srv *TokenService) Decode(tokenString, key string) (*CustomClaims, error)

Decode a token string into a token object

func (*TokenService) Encode

func (srv *TokenService) Encode(user *pb.User, key string) (string, error)

Encode a claim into a JWT

Jump to

Keyboard shortcuts

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