Documentation
¶
Index ¶
- Constants
- func Hash(rawKey string) string
- func SignRequest(app, ts, secret string, request []byte) (string, error)
- type AuthKey
- type AuthService
- type AuthServiceParam
- type AuthedGroutRoute
- func NewAuthedRouter(route *gin.Engine, auth *AuthService, logger *zap.Logger, base string, ...) AuthedGroutRoute
- func NewDefaultAuthedRouter(route *gin.Engine, auth *AuthService, logger *zap.Logger) AuthedGroutRoute
- func NewRouterRequiredAuth(group *gin.RouterGroup, auth *AuthService) AuthedGroutRoute
- func NewURIAuthedRouter(route *gin.Engine, auth *AuthService, logger *zap.Logger, uri string) AuthedGroutRoute
- type SignService
Constants ¶
View Source
const (
KeyUser = "currentUser"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthService ¶
type AuthService struct { Db *gorm.DB Keys []string HeaderKey string // contains filtered or unexported fields }
func (*AuthService) Auth ¶
func (a *AuthService) Auth(c *gin.Context)
func (*AuthService) CreateUser ¶ added in v0.1.7
func (a *AuthService) CreateUser(owner, username, remark, rawKey string) (string, error)
type AuthServiceParam ¶ added in v0.0.8
type AuthedGroutRoute ¶ added in v0.1.6
func NewAuthedRouter ¶ added in v0.1.6
func NewAuthedRouter(route *gin.Engine, auth *AuthService, logger *zap.Logger, base string, replyCode int) AuthedGroutRoute
func NewDefaultAuthedRouter ¶ added in v0.1.6
func NewDefaultAuthedRouter(route *gin.Engine, auth *AuthService, logger *zap.Logger) AuthedGroutRoute
func NewRouterRequiredAuth ¶ added in v0.0.8
func NewRouterRequiredAuth(group *gin.RouterGroup, auth *AuthService) AuthedGroutRoute
func NewURIAuthedRouter ¶ added in v0.2.1
func NewURIAuthedRouter(route *gin.Engine, auth *AuthService, logger *zap.Logger, uri string) AuthedGroutRoute
type SignService ¶ added in v0.1.12
type SignService struct { MaxDuration time.Duration KeyTimestamp string KeySign string KeyApp string Secrets map[string]string // contains filtered or unexported fields }
func (*SignService) CheckMaxDuration ¶ added in v0.1.12
func (ss *SignService) CheckMaxDuration(c *gin.Context)
func (*SignService) Sign ¶ added in v0.1.12
func (ss *SignService) Sign(c *gin.Context)
Click to show internal directories.
Click to hide internal directories.