Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDeleteNotAllowed = errors.New("You can't delete this comment")
View Source
var ErrNoComment = errors.New("Comment not found")
View Source
var ErrNoLike = errors.New("Like not found")
View Source
var ErrNoPhoto = errors.New("Photo not found")
View Source
var ErrNoUser = errors.New("User not found")
View Source
var ErrPhotoFormatNotSupported = errors.New("Unsupported image type")
View Source
var ErrUserForbidden = errors.New("You are not authorized to do this operations")
Functions ¶
func NewWorkersFacade ¶
Types ¶
type AuthService ¶
type AuthService interface { DoLogin(username string) (token string, newUser bool, err error) Authorize(token string) (*models.BaseUser, error) }
func NewAuthService ¶
func NewAuthService(ar repositories.AuthRepository, ur repositories.UsersRepository) AuthService
type BansService ¶
type BansService interface { BanUser(int, int) error UnbanUser(int, int) error IsBannedForUser(int, int) (bool, error) }
BansService defines the api actions to ban/unban a user
func NewBansService ¶
func NewBansService( ur repositories.UsersRepository, br repositories.BansRepository, fr repositories.FollowsRepository, ) BansService
NewBansService creates a default api service
type CommentsService ¶
type CommentsService interface { CommentPhoto(int, int, string) (*models.Comment, error) UncommentPhoto(int, int, int) error GetPhotoComments(int, int) (*[]models.Comment, error) }
CommentsService defines the api actions to comment/uncomment a photo
func NewCommentsService ¶
func NewCommentsService(ur repositories.UsersRepository, br repositories.BansRepository, cr repositories.CommentsRepository, pr repositories.PhotosRepository) CommentsService
NewCommentsService creates a default api service
type FollowsService ¶
type FollowsService interface { FollowUser(int, int) error GetUserFollowers(int, int) (*[]models.BaseUser, error) GetUserFollowings(int, int) (*[]models.BaseUser, error) UnfollowUser(int, int) error }
FollowsService defines the api actions to follow/unfollow a user
func NewFollowsService ¶
func NewFollowsService(ur repositories.UsersRepository, br repositories.BansRepository, fr repositories.FollowsRepository) FollowsService
NewFollowsService creates a default api service
type LikesService ¶
type LikesService interface { LikePhoto(int, int) error UnlikePhoto(int, int) error GetPhotoLikes(int, int) (*[]models.Like, error) }
LikesService defines the api actions to like/unlike a photo
func NewLikesService ¶
func NewLikesService(ur repositories.UsersRepository, br repositories.BansRepository, lr repositories.LikesRepository, pr repositories.PhotosRepository) LikesService
NewLikesService creates a default api service
type PhotosService ¶
type PhotosService interface { GetUserPhotos(int, int, int, int) (*models.PaginatedPhotos, error) GetStream(int, int, int) (*models.PaginatedPhotos, error) CreatePhoto(int, io.Reader) (*models.Photo, error) DeletePhoto(int, int) error }
PhotosService defines the api actions to manage photos
func NewPhotosService ¶
func NewPhotosService( photosDirectory string, photosUrlPath string, ur repositories.UsersRepository, br repositories.BansRepository, pr repositories.PhotosRepository, lr repositories.LikesRepository, cr repositories.CommentsRepository, fr repositories.FollowsRepository, ) PhotosService
NewPhotosService creates a default api service
type UsersService ¶
type UsersService interface { GetUser(int, int) (*models.FullUser, error) GetUsers(int, string) (*[]models.BaseUser, error) UpdateUsername(int, string) (*models.FullUser, error) }
func NewUsersService ¶
func NewUsersService( ur repositories.UsersRepository, br repositories.BansRepository, fr repositories.FollowsRepository, pr repositories.PhotosRepository, ) UsersService
Click to show internal directories.
Click to hide internal directories.