Documentation
¶
Index ¶
- type ArticleMongoDataService
- func (ds *ArticleMongoDataService) Create(title string, author *model.User, content string) *model.Article
- func (ds *ArticleMongoDataService) DeleteArticle(id int)
- func (ds *ArticleMongoDataService) Get(id string) *model.Article
- func (ds *ArticleMongoDataService) List() []*model.Article
- func (ds *ArticleMongoDataService) Update(id int)
- type UserMongoDataService
- func (ds *UserMongoDataService) Create(data map[string]string) *model.User
- func (ds *UserMongoDataService) Delete(id string) *model.User
- func (ds *UserMongoDataService) Get(id string) (*model.User, error)
- func (ds *UserMongoDataService) List() []*model.User
- func (ds *UserMongoDataService) Update(id string, data map[string]string) *model.User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArticleMongoDataService ¶
type ArticleMongoDataService struct {
Collection *mongo.Collection
}
func (*ArticleMongoDataService) DeleteArticle ¶
func (ds *ArticleMongoDataService) DeleteArticle(id int)
func (*ArticleMongoDataService) Get ¶
func (ds *ArticleMongoDataService) Get(id string) *model.Article
func (*ArticleMongoDataService) List ¶
func (ds *ArticleMongoDataService) List() []*model.Article
func (*ArticleMongoDataService) Update ¶
func (ds *ArticleMongoDataService) Update(id int)
type UserMongoDataService ¶
type UserMongoDataService struct {
Collection *mongo.Collection
}
func (*UserMongoDataService) Create ¶
func (ds *UserMongoDataService) Create(data map[string]string) *model.User
func (*UserMongoDataService) Get ¶
func (ds *UserMongoDataService) Get(id string) (*model.User, error)
func (*UserMongoDataService) List ¶
func (ds *UserMongoDataService) List() []*model.User
Click to show internal directories.
Click to hide internal directories.