mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
20 lines
634 B
Go
20 lines
634 B
Go
package interfaces
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/golang-jwt/jwt/v5"
|
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
|
)
|
|
|
|
type UserService interface {
|
|
Init() (err error)
|
|
SetJwtSecret(secret string)
|
|
SetJwtSigningMethod(method jwt.SigningMethod)
|
|
Create(opts *UserCreateOptions, args ...interface{}) (err error)
|
|
Login(opts *UserLoginOptions) (token string, u User, err error)
|
|
CheckToken(token string) (u User, err error)
|
|
ChangePassword(id primitive.ObjectID, password string, args ...interface{}) (err error)
|
|
MakeToken(user User) (tokenStr string, err error)
|
|
GetCurrentUser(c *gin.Context) (u User, err error)
|
|
}
|