api

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecretKey  = "sillyhattest"
	TokenKey   = "SILLY-HAT-TOKEN"
	ContextKey = "SILLY-HAT-TOKEN"
)

Variables

View Source
var JWTClient *jwtutils.JWT

Functions

func InitialAPI

func InitialAPI(port int)

func SetupRouter

func SetupRouter() *gin.Engine

Types

type Auth

type Auth struct {
	JWTClient  *jwtutils.JWT
	TokenKey   string
	ContextKey string
	Debug      bool
}

func (*Auth) GetAuth

func (auth *Auth) GetAuth(token string) (interface{}, error)

func (*Auth) GetAuthForDebug

func (auth *Auth) GetAuthForDebug(ctx *gin.Context) (interface{}, error)

func (*Auth) GetContextKey

func (auth *Auth) GetContextKey() string

func (*Auth) GetJWTClient

func (auth *Auth) GetJWTClient() *jwtutils.JWT

func (*Auth) GetTokenKey

func (auth *Auth) GetTokenKey() string

func (*Auth) IsDebug

func (auth *Auth) IsDebug() bool

type User

type User struct {
	UserId string `json:"userId"`
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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