Documentation
¶
Index ¶
- Variables
- type AdService
- func (a *AdService) ChangeAdStatus(adId int64, userId int64, published bool) (ads.Ad, error)
- func (a *AdService) CreateAd(title string, text string, userId int64) (ads.Ad, error)
- func (a *AdService) CreateUser(name string, email string) (users.User, error)
- func (a *AdService) DeleteAd(adId int64, userId int64) error
- func (a *AdService) DeleteUser(userId int64) error
- func (a *AdService) GetAd(adId int64) (ads.Ad, error)
- func (a *AdService) GetUser(userId int64) (users.User, error)
- func (a *AdService) ListAds(pubFilter bool, userFilter int64, timeFilter time.Time) ([]ads.Ad, error)
- func (a *AdService) SearchAds(pattern string) ([]ads.Ad, error)
- func (a *AdService) UpdateAd(adId int64, userId int64, title string, text string) (ads.Ad, error)
- func (a *AdService) UpdateUser(userId int64, name string, email string) (users.User, error)
- type App
- type Repository
Constants ¶
This section is empty.
Variables ¶
View Source
var DefunctAd = errors.New("there is no ad with this ID")
View Source
var DefunctUser = errors.New("there is no user with this ID")
View Source
var PermissionDenied = errors.New("the user does not have enough permission to edit the ad")
Functions ¶
This section is empty.
Types ¶
type AdService ¶
type AdService struct {
// contains filtered or unexported fields
}
func (*AdService) ChangeAdStatus ¶
func (*AdService) CreateUser ¶
func (*AdService) DeleteUser ¶
type App ¶
type App interface {
CreateAd(title string, text string, userId int64) (ads.Ad, error)
ChangeAdStatus(adId int64, userId int64, published bool) (ads.Ad, error)
UpdateAd(adId int64, userId int64, title string, text string) (ads.Ad, error)
GetAd(adId int64) (ads.Ad, error)
DeleteAd(adId int64, userId int64) error
ListAds(pubFilter bool, userFilter int64, timeFilter time.Time) ([]ads.Ad, error)
SearchAds(pattern string) ([]ads.Ad, error)
CreateUser(name string, email string) (users.User, error)
UpdateUser(userId int64, name string, email string) (users.User, error)
GetUser(userId int64) (users.User, error)
DeleteUser(userId int64) error
}
func NewApp ¶
func NewApp(adRepo Repository, userRepo Repository) App
Click to show internal directories.
Click to hide internal directories.