Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Book ¶
type Book struct { ID int64 `json:"id" swaggerignore:"true"` Title string `json:"title" validate:"required"` Subtitle string `json:"subtitle" validate:"required"` AboutTheBook string `json:"about_the_book" db:"about_the_book" validate:"required"` PageCount int64 `json:"page_count" db:"page_count" validate:"required"` Price float64 `json:"price" validate:"required"` Image string `json:"image" validate:"required,url"` Language string `json:"language" validate:"required"` AuthorName string `json:"author_name" db:"author_name" validate:"required"` AuthorAvatar string `json:"author_avatar" db:"author_avatar" validate:"required,url"` CategoryId int64 `json:"category_id" db:"category_id" validate:"required"` }
Book is representing the Book data struct
type BookRepository ¶
type BookRepository interface { GetByID(ctx context.Context, id int64) (*Book, error) GetAll(ctx context.Context, p *pagination.PaginationQuery) ([]Books, error) GetByCategory(ctx context.Context, category string, p *pagination.PaginationQuery) ([]Books, error) InsertBook(ctx context.Context, book *Book) (int64, error) DeleteBook(ctx context.Context, id int64) error }
BookRepository represent the Book's repository contract
type BookUseCase ¶
type BookUseCase interface { GetByID(ctx context.Context, id int64) (*Book, error) GetByCategory(ctx context.Context, category string, p *pagination.PaginationQuery) ([]Books, error) GetAll(ctx context.Context, p *pagination.PaginationQuery) ([]Books, error) InsertBook(ctx context.Context, book *Book) (int64, error) DeleteBook(ctx context.Context, id int64) error }
BookUsecase represent the Book's usecases
type CategoryRepository ¶
type CategoryRepository interface { GetAll(ctx context.Context, params *p.PaginationQuery) ([]Category, error) GetByID(ctx context.Context, id int64) (*Category, error) InsertCategory(ctx context.Context, c *Category) (int64, error) DeleteCategory(ctx context.Context, id int64) error UpdateCategory(ctx context.Context, c *Category) error }
type CategoryUseCase ¶
type CategoryUseCase interface { GetAll(ctx context.Context, params *p.PaginationQuery) ([]Category, error) GetByID(ctx context.Context, id int64) (*Category, error) InsertCategory(ctx context.Context, c *Category) (int64, error) DeleteCategory(ctx context.Context, id int64) error UpdateCategory(ctx context.Context, c *Category) error }
type GetUserResponse ¶
type LoginRequest ¶
type SignUpRequest ¶
type SignUpRequest struct { Email string `json:"email" form:"email" validate:"required,email"` Password string `json:"password" form:"password" validate:"required,eqfield=PasswordConfirmation,min=8,max=28"` PasswordConfirmation string `json:"password_confirmation" form:"password_confirmation" validate:"required,min=8,max=28"` HashedPassword string `json:"hashed_password" swaggerignore:"true"` }
type TokenResponse ¶
type UserRepository ¶
type UserRepository interface { Insert(ctx context.Context, user *SignUpRequest) (int64, error) FindById(ctx context.Context, id int64) (*GetUserResponse, error) FindByEmail(ctx context.Context, email string) (*User, error) Delete(ctx context.Context, userId int64) error }
UserRepository represent the User's repository contract
type UserUseCase ¶
type UserUseCase interface { GetUserByID(ctx context.Context, id int64) (*GetUserResponse, error) RegisterUser(ctx context.Context, user *SignUpRequest) (*TokenResponse, error) LoginUser(ctx context.Context, user *LoginRequest) (*TokenResponse, error) DeleteUser(ctx context.Context, userId int64) error }
UserUsecase represent the User's usecases
Click to show internal directories.
Click to hide internal directories.