services

package
v0.0.0-...-5e06dbd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArticleService

type ArticleService struct {
	Logger *logrus.Logger
	DB     *gorm.DB
}

ArticleService struct

func (*ArticleService) DeleteAllArticles

func (a *ArticleService) DeleteAllArticles() (int64, error)

DeleteAllArticles func

func (*ArticleService) DeleteByID

func (a *ArticleService) DeleteByID(id uint64, uid uint64) (int64, error)

DeleteByID func

func (*ArticleService) FetchArticleByID

func (a *ArticleService) FetchArticleByID(id uint64) (models.Article, error)

FetchArticleByID func

func (*ArticleService) GetAllArticles

func (a *ArticleService) GetAllArticles() ([]models.Article, error)

GetAllArticles returns all articles

func (*ArticleService) SaveArticle

func (a *ArticleService) SaveArticle(article *models.Article) (*models.Article, error)

SaveArticle func

func (*ArticleService) UpdateArticle

func (a *ArticleService) UpdateArticle(updated *models.Article, aid int64, uid uint64) (int64, error)

UpdateArticle func using wait groups for fun !!!!

type UserService

type UserService struct {
	Logger *logrus.Logger
	DB     *gorm.DB
}

UserService struct

func (*UserService) FindAll

func (u *UserService) FindAll() ([]models.User, error)

FindAll Fetch all the Users

func (*UserService) FindUserByID

func (u *UserService) FindUserByID(uid uint64) (models.User, error)

FindUserByID Fetch user by id

func (*UserService) Save

func (u *UserService) Save(user *models.User) (*models.User, error)

Save method of UserRepository interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL