Documentation
¶
Index ¶
- type ArticleRepository
- type CachedArticleRepository
- type CachedMsUserRepository
- type CachedUserRepository
- func (repo *CachedUserRepository) Create(ctx context.Context, u User) error
- func (repo *CachedUserRepository) EditProfile(ctx context.Context, u User) (User, error)
- func (repo *CachedUserRepository) FindByEmail(ctx context.Context, email string) (User, error)
- func (repo *CachedUserRepository) FindById(ctx context.Context, uid int64) (User, error)
- func (repo *CachedUserRepository) FindByPhone(ctx context.Context, phone string) (User, error)
- func (r *CachedUserRepository) FindByWechat(ctx context.Context, openID string) (User, error)
- type CaptchaRepository
- type MsUser
- type MsUserRepository
- type User
- type UserRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArticleRepository ¶
type ArticleRepository interface {
Create(ctx context.Context, art article.Article) (int64, error)
Update(ctx context.Context, art article.Article) error
}
func NewArticleRepository ¶
func NewArticleRepository(dao article.ArticleDAO) ArticleRepository
type CachedArticleRepository ¶
type CachedArticleRepository struct {
// contains filtered or unexported fields
}
type CachedMsUserRepository ¶
type CachedMsUserRepository struct {
// contains filtered or unexported fields
}
func (*CachedMsUserRepository) Create ¶
func (repo *CachedMsUserRepository) Create(ctx context.Context, u MsUser) error
func (*CachedMsUserRepository) FindByUsername ¶
type CachedUserRepository ¶
type CachedUserRepository struct {
// contains filtered or unexported fields
}
func (*CachedUserRepository) Create ¶
func (repo *CachedUserRepository) Create(ctx context.Context, u User) error
func (*CachedUserRepository) EditProfile ¶
func (*CachedUserRepository) FindByEmail ¶
func (*CachedUserRepository) FindByPhone ¶
func (*CachedUserRepository) FindByWechat ¶
type CaptchaRepository ¶
type CaptchaRepository interface {
Store(ctx context.Context, biz string, phone string, captcha string) error
Verify(ctx context.Context, biz string, phone string, inputcode string) (bool, error)
}
func NewCaptchaRepository ¶
func NewCaptchaRepository(c cache.CaptchaCache) CaptchaRepository
type MsUserRepository ¶
type MsUserRepository interface {
Create(ctx context.Context, u MsUser) error
FindByUsername(ctx context.Context, username string) (MsUser, error)
}
func NewMsUserRepository ¶
func NewMsUserRepository(dao dao.MsUserDAO) MsUserRepository
type UserRepository ¶
type UserRepository interface {
Create(ctx context.Context, u User) error
FindById(ctx context.Context, uid int64) (User, error)
FindByEmail(ctx context.Context, email string) (User, error)
FindByPhone(ctx context.Context, phone string) (User, error)
FindByWechat(ctx context.Context, openID string) (User, error)
EditProfile(ctx context.Context, u User) (User, error)
}
func NewUserRepository ¶
func NewUserRepository(dao dao.UserDAO, cache cache.UserCache) UserRepository
Directories
¶
| Path | Synopsis |
|---|---|
|
mocks
Package cachemock is a generated GoMock package.
|
Package cachemock is a generated GoMock package. |
|
redismocks
Package redismocks is a generated GoMock package.
|
Package redismocks is a generated GoMock package. |
|
mocks
Package daomock is a generated GoMock package.
|
Package daomock is a generated GoMock package. |
|
Package repomock is a generated GoMock package.
|
Package repomock is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.