usecase

package
v0.0.0-...-47b434b Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDecodeImage = errors.New("image decode failure")
View Source
var ErrLikeYourSelf = errors.New("you can't like your posting")
View Source
var ErrNotCatImage = errors.New("you can post only a cat image")
View Source
var ErrNotCorrectPassword = errors.New("not correct password")
View Source
var ErrNotVerifiedUser = errors.New("not email verified user")
View Source
var ErrOverPasswordResetCount = errors.New("you can't reset password as it exceeds limit counts")

Functions

This section is empty.

Types

type ChangePassword

type ChangePassword struct {
	// contains filtered or unexported fields
}

func NewChangePassword

func NewChangePassword(ctx context.Context, tx mysql.DBTransaction, tokenUserName string, reqChangePassword *modelHTTP.RequestChangePassword, userRepo *repository.UserRepository) *ChangePassword

func (*ChangePassword) ChangePasswordUseCase

func (user *ChangePassword) ChangePasswordUseCase() error

type ChangePasswordUseCaseInterface

type ChangePasswordUseCaseInterface interface {
	ChangePasswordUseCase() (*model.User, error)
}

type DeleteComment

type DeleteComment struct {
	// contains filtered or unexported fields
}

func NewDeleteComment

func NewDeleteComment(ctx context.Context, tx mysql.DBTransaction, tokenUserName string, commentID int64, userRepo *repository.UserRepository, commentRepo *repository.CommentRepository) *DeleteComment

func (*DeleteComment) DeleteCommentUseCase

func (comment *DeleteComment) DeleteCommentUseCase() error

type DeleteCommentUseCaseInterface

type DeleteCommentUseCaseInterface interface {
	DeleteCommentUseCase() (*model.Comment, error)
}

type DeleteFollow

type DeleteFollow struct {
	// contains filtered or unexported fields
}

func NewDeleteFollow

func NewDeleteFollow(ctx context.Context, tx mysql.DBTransaction, followUserName, followedUserName string, userRepo *repository.UserRepository, followRepo *repository.FollowRepository) *DeleteFollow

func (*DeleteFollow) DeleteFollowUseCase

func (follow *DeleteFollow) DeleteFollowUseCase() error

type DeleteFollowUseCaseInterface

type DeleteFollowUseCaseInterface interface {
	DeleteFollowUseCase() (*model.Follow, error)
}

type DeleteLike

type DeleteLike struct {
	// contains filtered or unexported fields
}

func NewDeleteLike

func NewDeleteLike(ctx context.Context, tx mysql.DBTransaction, tokenUserName string, postingID int64, userRepo *repository.UserRepository, postingRepo *repository.PostingRepository, likeRepo *repository.LikeRepository) *DeleteLike

func (*DeleteLike) DeleteLikeUseCase

func (like *DeleteLike) DeleteLikeUseCase() error

type DeleteLikeUseCaseInterface

type DeleteLikeUseCaseInterface interface {
	DeleteLikeUseCase() (*model.Like, error)
}

type DeletePosting

type DeletePosting struct {
	// contains filtered or unexported fields
}

func NewDeletePosting

func NewDeletePosting(ctx context.Context, tx mysql.DBTransaction, postingID int64, tokenUserName string, userRepo *repository.UserRepository, postingRepo *repository.PostingRepository) *DeletePosting

func (*DeletePosting) DeletePostingUseCase

func (posting *DeletePosting) DeletePostingUseCase() error

type DeletePostingUseCaseInterface

type DeletePostingUseCaseInterface interface {
	DeletePostingUseCase() error
}

type DeleteUser

type DeleteUser struct {
	// contains filtered or unexported fields
}

func (*DeleteUser) DeleteUserUseCase

func (user *DeleteUser) DeleteUserUseCase() error

type DeleteUserUseCaseInterface

type DeleteUserUseCaseInterface interface {
	DeleteUserUseCase() (*model.User, error)
}

type GetComments

type GetComments struct {
	// contains filtered or unexported fields
}

func NewGetComments

func NewGetComments(ctx context.Context, tx mysql.DBTransaction, tokenUserName string, postingID int64, userRepo *repository.UserRepository, postingRepo *repository.PostingRepository, commentRepo *repository.CommentRepository) *GetComments

func (*GetComments) GetCommentsUseCase

func (c *GetComments) GetCommentsUseCase() (comments []model.Comment, err error)

type GetCommentsUseCaseInterface

type GetCommentsUseCaseInterface interface {
	GetCommentsUseCase() (*model.Comment, error)
}

type GetNotifications

type GetNotifications struct {
	// contains filtered or unexported fields
}

func NewGetNotifications

func NewGetNotifications(ctx context.Context, tx mysql.DBTransaction, tokenUserName, visitedName string, userRepo *repository.UserRepository, notificationRepo *repository.NotificationRepository) *GetNotifications

func (*GetNotifications) GetNotificationsUseCase

func (n *GetNotifications) GetNotificationsUseCase() (notifications []model.Notification, err error)

type GetNotificationsUseCaseInterface

type GetNotificationsUseCaseInterface interface {
	GetNotificationsUseCase() (*model.Notification, error)
}

type GetPostings

type GetPostings struct {
	// contains filtered or unexported fields
}

func NewGetPostings

func NewGetPostings(ctx context.Context, tx mysql.DBTransaction, tokenUserName string, sinceAt time.Time, limit int8, userName string, userRepo *repository.UserRepository, postingRepo *repository.PostingRepository, likeRepo *repository.LikeRepository) *GetPostings

func (*GetPostings) GetPostingsUseCase

func (p *GetPostings) GetPostingsUseCase() (postings []model.Posting, likes []model.Like, err error)

type GetPostingsUseCaseInterface

type GetPostingsUseCaseInterface interface {
	GetPostingsUseCase() (*model.Posting, error)
}

type GetUser

type GetUser struct {
	// contains filtered or unexported fields
}

func NewGetUser

func NewGetUser(ctx context.Context, tx mysql.DBTransaction, tokenUserName, userName string, userRepo *repository.UserRepository) *GetUser

func (*GetUser) GetUserUseCase

func (user *GetUser) GetUserUseCase() (u model.User, err error)

type GetUserUseCaseInterface

type GetUserUseCaseInterface interface {
	GetUserUseCase() (*model.User, error)
}

type Login

type Login struct {
	// contains filtered or unexported fields
}

func NewLogin

func NewLogin(ctx context.Context, tx mysql.DBTransaction, reqLogin *modelHTTP.RequestLogin, userRepo *repository.UserRepository) *Login

func (*Login) LoginUseCase

func (l *Login) LoginUseCase() (idToken string, err error)

type LoginUseCaseInterface

type LoginUseCaseInterface interface {
	LoginUseCase() (string, error)
}

type PasswordReset

type PasswordReset struct {
	// contains filtered or unexported fields
}

func NewPasswordReset

func NewPasswordReset(ctx context.Context, tx mysql.DBTransaction, reqPasswordReset *modelHTTP.RequestResetPassword, userRepo *repository.UserRepository) *PasswordReset

func (*PasswordReset) PasswordResetUseCase

func (reset *PasswordReset) PasswordResetUseCase() (err error)

type PasswordResetEmail

type PasswordResetEmail struct {
	// contains filtered or unexported fields
}

func NewPasswordResetEmail

func NewPasswordResetEmail(ctx context.Context, tx mysql.DBTransaction, reqPasswordResetEmail *modelHTTP.Email, userRepo *repository.UserRepository) *PasswordResetEmail

func (*PasswordResetEmail) PasswordResetEmailUseCase

func (re *PasswordResetEmail) PasswordResetEmailUseCase() (err error)

type PasswordResetEmailUseCaseInterface

type PasswordResetEmailUseCaseInterface interface {
	PasswordResetEmailUseCase() error
}

type PasswordResetUseCaseInterface

type PasswordResetUseCaseInterface interface {
	PasswordResetUseCase() error
}

type RegisterComment

type RegisterComment struct {
	// contains filtered or unexported fields
}

func NewRegisterComment

func NewRegisterComment(ctx context.Context, tx mysql.DBTransaction, tokenUserName string, reqRegisterComment *modelHTTP.Comment, userRepo *repository.UserRepository, postingRepo *repository.PostingRepository, commentRepo *repository.CommentRepository, notificationRepo *repository.NotificationRepository) *RegisterComment

func (*RegisterComment) RegisterCommentUseCase

func (comment *RegisterComment) RegisterCommentUseCase() error

type RegisterCommentUseCaseInterface

type RegisterCommentUseCaseInterface interface {
	RegisterCommentUseCase() (*model.Comment, error)
}

type RegisterFollow

type RegisterFollow struct {
	// contains filtered or unexported fields
}

func NewRegisterFollow

func NewRegisterFollow(ctx context.Context, tx mysql.DBTransaction, tokenUserName string, reqRegisterFollow *modelHTTP.Follow, userRepo *repository.UserRepository, followRepo *repository.FollowRepository, notificationRepo *repository.NotificationRepository) *RegisterFollow

func (*RegisterFollow) RegisterFollowUseCase

func (follow *RegisterFollow) RegisterFollowUseCase() error

type RegisterFollowUseCaseInterface

type RegisterFollowUseCaseInterface interface {
	RegisterFollowUseCase() (*model.Follow, error)
}

type RegisterLike

type RegisterLike struct {
	// contains filtered or unexported fields
}

func NewRegisterLike

func NewRegisterLike(ctx context.Context, tx mysql.DBTransaction, tokenUserName string, reqRegisterLike *modelHTTP.Like, userRepo *repository.UserRepository, postingRepo *repository.PostingRepository, likeRepo *repository.LikeRepository, notificationRepo *repository.NotificationRepository) *RegisterLike

func (*RegisterLike) RegisterLikeUseCase

func (like *RegisterLike) RegisterLikeUseCase() error

type RegisterLikeUseCaseInterface

type RegisterLikeUseCaseInterface interface {
	RegisterLikeUseCase() (*model.Like, error)
}

type RegisterPosting

type RegisterPosting struct {
	// contains filtered or unexported fields
}

func NewRegisterPosting

func NewRegisterPosting(ctx context.Context, tx mysql.DBTransaction, tokenUserName string, reqRegisterPosting *modelHTTP.RequestRegisterPosting, userRepo *repository.UserRepository, postingRepo *repository.PostingRepository) *RegisterPosting

func (*RegisterPosting) RegisterPostingUseCase

func (posting *RegisterPosting) RegisterPostingUseCase() error

type RegisterPostingUseCaseInterface

type RegisterPostingUseCaseInterface interface {
	RegisterPostingUseCase() (*model.Posting, error)
}

type RegisterUser

type RegisterUser struct {
	// contains filtered or unexported fields
}

func NewRegisterUser

func NewRegisterUser(ctx context.Context, tx mysql.DBTransaction, reqRegisterUser *modelHTTP.RequestRegisterUser, userRepo *repository.UserRepository) *RegisterUser

func (*RegisterUser) RegisterUserUseCase

func (user *RegisterUser) RegisterUserUseCase() error

type RegisterUserUseCaseInterface

type RegisterUserUseCaseInterface interface {
	RegisterUserUseCase() (*model.User, error)
}

type UpdateActivationUseCaseInterface

type UpdateActivationUseCaseInterface interface {
	UserActivationUseCase() (*model.User, error)
}

type UpdateUser

type UpdateUser struct {
	// contains filtered or unexported fields
}

func NewUpdateUser

func NewUpdateUser(ctx context.Context, tx mysql.DBTransaction, userName string, reqUpdateUser *modelHTTP.RequestUpdateUser, userRepo *repository.UserRepository) *UpdateUser

func (*UpdateUser) UpdateUserUseCase

func (user *UpdateUser) UpdateUserUseCase() error

type UpdateUserUseCaseInterface

type UpdateUserUseCaseInterface interface {
	UpdateUserUseCase() (*model.User, error)
}

type UserActivation

type UserActivation struct {
	// contains filtered or unexported fields
}

func NewUserActivation

func NewUserActivation(ctx context.Context, tx mysql.DBTransaction, userName, activationKey string, userRepo *repository.UserRepository) *UserActivation

func (*UserActivation) UserActivationUseCase

func (ua *UserActivation) UserActivationUseCase() error

Jump to

Keyboard shortcuts

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