Documentation
¶
Index ¶
- type ArticleRepository
- func (repo *ArticleRepository) Delete(id string) (bool, error)
- func (repo *ArticleRepository) GetAll() ([]*model.Article, error)
- func (repo *ArticleRepository) GetCreationStream() chan *model.Article
- func (repo *ArticleRepository) GetSingle(id string) (*model.Article, error)
- func (repo *ArticleRepository) Save(article *model.Article) (*model.Article, error)
- type IArticleRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArticleRepository ¶
type ArticleRepository struct {
// contains filtered or unexported fields
}
func NewArticleRepository ¶
func NewArticleRepository(db *cache2go.CacheTable) *ArticleRepository
Creates a new article instance
func (*ArticleRepository) Delete ¶
func (repo *ArticleRepository) Delete(id string) (bool, error)
Delete an article from database by its id. Returning false and error, when no object with the given was where found.
func (*ArticleRepository) GetAll ¶
func (repo *ArticleRepository) GetAll() ([]*model.Article, error)
Fetches a list all Articles from the database.
func (*ArticleRepository) GetCreationStream ¶
func (repo *ArticleRepository) GetCreationStream() chan *model.Article
Returns a channel receiving all Articles that will be created.
func (*ArticleRepository) GetSingle ¶
func (repo *ArticleRepository) GetSingle(id string) (*model.Article, error)
Fetches a single Article by its id. Returning nil as Article when no Article with the given ID was found.
Click to show internal directories.
Click to hide internal directories.