usecases

package
v0.0.0-...-c9b1956 Latest Latest
Warning

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

Go to latest
Published: May 9, 2018 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmailInUse = errors.New("The mail address is already registered")

TODO: Validate mail address (is there an "@", etc.)

View Source
var ErrInvalidZipCode = errors.New("Invalid ZipCode length")
View Source
var ErrPasswordNotMatch = errors.New("The password was not correct")
View Source
var ErrUserDisabled = errors.New("User is disabled")

Functions

This section is empty.

Types

type ImageUsecases

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

func NewImageUsecases

func NewImageUsecases(imageRepository imageRepositoryInterface) ImageUsecases

func (*ImageUsecases) RetrieveUserProfilePicture

func (interactor *ImageUsecases) RetrieveUserProfilePicture(userId int64) ([]byte, error)

func (*ImageUsecases) StoreUserProfilePicture

func (interactor *ImageUsecases) StoreUserProfilePicture(userId int64, dat []byte) error

type PostUsecases

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

func NewPostUsecases

func NewPostUsecases(postRepository postRepositoryInterface) PostUsecases

func (*PostUsecases) FindNewestPosts

func (interactor *PostUsecases) FindNewestPosts(limit, offset int64) ([]*domain.Post, error)

func (*PostUsecases) FindPostByID

func (interactor *PostUsecases) FindPostByID(postID int64) (domain.Post, error)

func (*PostUsecases) FindPostsByUserID

func (interactor *PostUsecases) FindPostsByUserID(userID int64, limit, offset int64) ([]*domain.Post, error)

func (*PostUsecases) PublishPost

func (interactor *PostUsecases) PublishPost(userID int64, text string, time time.Time) (id int64, err error)

type UserUsecases

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

func NewUserUsecases

func NewUserUsecases(userRepository userRepositoryInterface) UserUsecases

func (*UserUsecases) CreateUser

func (interactor *UserUsecases) CreateUser(name, email, passwordPlain string) (id int64, err error)

func (*UserUsecases) DeleteUser

func (interactor *UserUsecases) DeleteUser(id int64, executingUser domain.User) error

func (*UserUsecases) FindUserById

func (interactor *UserUsecases) FindUserById(id int64) (domain.User, error)

func (*UserUsecases) FindUserIdByEmail

func (interactor *UserUsecases) FindUserIdByEmail(email string) (int64, error)

func (*UserUsecases) LoginUser

func (interactor *UserUsecases) LoginUser(userId int64, passwordPlain string) (bool, error)

func (*UserUsecases) UpdateUserExceptPassword

func (interactor *UserUsecases) UpdateUserExceptPassword(user domain.User) error

func (*UserUsecases) UpdateUserPasswordOnly

func (interactor *UserUsecases) UpdateUserPasswordOnly(userID int64, curPassPlain, newPassPlain string) error

func (*UserUsecases) VerifyEmailAndActivateUser

func (interactor *UserUsecases) VerifyEmailAndActivateUser(userId int64, tokenFromUrl string) error

Jump to

Keyboard shortcuts

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