Documentation ¶
Index ¶
- func BearerAuth(r *http.Request) (string, bool)
- func NewOauth2(db *gorm.DB, ts *oredis.TokenStore, clientStore oauth2.ClientStore) *server.Server
- func NewUserId() uuid.UUID
- func PasswordAuthorizationHandler(db *gorm.DB) func(context.Context, string, string, string) (string, error)
- type API
- func (a API) CreateUser(c *gin.Context)
- func (a API) CurrentUser(c *gin.Context)
- func (a API) DeleteUser(c *gin.Context)
- func (a API) ForgetPass(c *gin.Context)
- func (a API) GetUser(c *gin.Context)
- func (a API) GetUsers(c *gin.Context)
- func (a API) Login() gin.HandlerFunc
- func (a API) Logout() gin.HandlerFunc
- func (a API) OnlyAdmin() gin.HandlerFunc
- func (a API) ResetPass(c *gin.Context)
- func (a API) UpdateUser(c *gin.Context)
- func (a API) ValidateToken() gin.HandlerFunc
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type API ¶
type API struct { DB *gorm.DB Log *logrus.Logger Grpc userpb.UserServiceClient OauthConfig oauth2.Config TS *oredis.TokenStore SRV *server.Server }
func (API) CreateUser ¶
func (API) CurrentUser ¶
func (API) DeleteUser ¶
func (API) ForgetPass ¶
func (API) Login ¶
func (a API) Login() gin.HandlerFunc
func (API) Logout ¶
func (a API) Logout() gin.HandlerFunc
func (API) OnlyAdmin ¶
func (a API) OnlyAdmin() gin.HandlerFunc
func (API) UpdateUser ¶
func (API) ValidateToken ¶
func (a API) ValidateToken() gin.HandlerFunc
Click to show internal directories.
Click to hide internal directories.