user

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNS                        = errorx.NewNamespace("error.api.user")
	ErrNSSignIn                  = ErrNS.NewSubNamespace("signin")
	ErrSignInUnsupportedAuthType = ErrNSSignIn.NewType("unsupported_auth_type")
	ErrSignInOther               = ErrNSSignIn.NewType("other")
)

Functions

This section is empty.

Types

type AuthService

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

func NewAuthService

func NewAuthService(tidbForwarder *tidb.Forwarder) *AuthService

func (*AuthService) MWAuthRequired

func (s *AuthService) MWAuthRequired() gin.HandlerFunc

MWAuthRequired creates a middleware that verifies the authentication token (JWT) in the request. If the token is valid, identity information will be attached in the context. If there is no authentication token, or the token is invalid, subsequent handlers will be skipped and errors will be generated.

func (*AuthService) Register

func (s *AuthService) Register(r *gin.RouterGroup)

type TokenResponse

type TokenResponse struct {
	Token  string    `json:"token"`
	Expire time.Time `json:"expire"`
}

Jump to

Keyboard shortcuts

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