Documentation ¶
Index ¶
Constants ¶
View Source
const ( DB_NAME = "MicroServicePractice" CON_COLLECTION = "users" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CustomClaims ¶
自定义的 metadata 在加密后作为 JWT 的第二部分返回给客户端
type Repository ¶
type TokenService ¶
type TokenService struct { }
func GetTokenService ¶
func GetTokenService() *TokenService
func (*TokenService) Decode ¶
func (srv *TokenService) Decode(tokenStr string) (*CustomClaims, error)
将 JWT 字符串解密为 CustomClaims 对象
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
func GetUserRepository ¶
func GetUserRepository(session *mgo.Session) *UserRepository
func (*UserRepository) GetByEmail ¶
func (repo *UserRepository) GetByEmail(email string) (*pb.User, error)
Click to show internal directories.
Click to hide internal directories.