Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSessionNotFound = errors.New("not found")
View Source
var ErrUserIsActived = errors.New("已经激活")
Functions ¶
This section is empty.
Types ¶
type AuthRepository ¶
type AuthRepository interface {
ActivatedAccount(verifyCode string) (user *entity.User, err error)
}
func NewAuthRepository ¶
func NewAuthRepository(db *gorm.DB) AuthRepository
type SessionRepository ¶
type SessionRepository interface { Save(s entity.Session, key string) error Get(key string) (*entity.Session, error) Del(key string) error }
func NewSessionRepository ¶
func NewSessionRepository(pool *redis.Pool) SessionRepository
type UserRepository ¶
type UserRepository interface { Create(user *entity.User) error FindByID(id uint) (user *entity.User, err error) FindByEmail(email string) (user *entity.User, err error) }
UserRepository 定义 UserRepository 要实现的接口,提供给service
func NewUserRepository ¶
func NewUserRepository(db *gorm.DB) UserRepository
Click to show internal directories.
Click to hide internal directories.