Documentation ¶
Index ¶
- type AuthorRepository
- func (r *AuthorRepository) CreateAuthor(ctx context.Context, author *model.Author) (*model.Author, error)
- func (r *AuthorRepository) DeleteAuthor(ctx context.Context, authorID types.ID) error
- func (r *AuthorRepository) GetAuthor(ctx context.Context, authorID types.ID) (*model.Author, error)
- func (r *AuthorRepository) GetAuthors(ctx context.Context) ([]model.Author, error)
- func (r *AuthorRepository) UpdateAuthor(ctx context.Context, authorID types.ID, author *model.Author) error
- type BookRepository
- func (r *BookRepository) CreateBook(ctx context.Context, book *model.Book) (*model.Book, error)
- func (r *BookRepository) DeleteBook(ctx context.Context, bookID types.ID) error
- func (r *BookRepository) GetBook(ctx context.Context, bookID types.ID) (*model.Book, error)
- func (r *BookRepository) GetBooks(ctx context.Context) ([]model.Book, error)
- func (r *BookRepository) UpdateBook(ctx context.Context, bookID types.ID, book *model.Book) error
- type PropertyRepository
- type Repo
- type Repositories
- type UserRepository
- func (r *UserRepository) Create(ctx context.Context, input model.User) (*model.User, error)
- func (r *UserRepository) GetUserByID(ctx context.Context, userID types.UserID) (*model.User, error)
- func (r *UserRepository) GetUserByUsername(ctx context.Context, username types.Username) (*model.User, error)
- func (r *UserRepository) UpdateInfo(ctx context.Context, user model.User, userID types.UserID) error
- func (r *UserRepository) UpdatePassword(ctx context.Context, user model.User) error
- func (r *UserRepository) UpdateStatus(ctx context.Context, user model.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthorRepository ¶
type AuthorRepository struct {
// contains filtered or unexported fields
}
AuthorRepository is an interface for author repository
func NewAuthorRepository ¶
func NewAuthorRepository(pool database.ConnPool, log logger.Logger) *AuthorRepository
NewAuthorRepository creates new author repository
func (*AuthorRepository) CreateAuthor ¶
func (r *AuthorRepository) CreateAuthor(ctx context.Context, author *model.Author) (*model.Author, error)
CreateAuthor inserts new author
func (*AuthorRepository) DeleteAuthor ¶
DeleteAuthor deletes author
func (*AuthorRepository) GetAuthors ¶
GetAuthors returns all authors
func (*AuthorRepository) UpdateAuthor ¶
func (r *AuthorRepository) UpdateAuthor( ctx context.Context, authorID types.ID, author *model.Author, ) error
UpdateAuthor updates author
type BookRepository ¶
type BookRepository struct {
// contains filtered or unexported fields
}
BookRepository is an interface for book repository
func NewBookRepository ¶
func NewBookRepository(pool database.ConnPool, log logger.Logger) *BookRepository
NewBookRepository creates new book repository
func (*BookRepository) CreateBook ¶
CreateBook create book
func (*BookRepository) DeleteBook ¶
DeleteBook delete book by ID
func (*BookRepository) UpdateBook ¶
func (r *BookRepository) UpdateBook( ctx context.Context, bookID types.ID, book *model.Book, ) error
UpdateBook update book by userID and ID
type PropertyRepository ¶
type PropertyRepository struct {
// contains filtered or unexported fields
}
PropertyRepository is an interface for property repository
func NewPropertyRepository ¶
func NewPropertyRepository(pool database.ConnPool, log logger.Logger) *PropertyRepository
NewPropertyRepository creates new property repository
func (*PropertyRepository) GetTos ¶
func (r *PropertyRepository) GetTos(ctx context.Context) (*model.TermOfService, error)
GetTos get term of service
type Repo ¶
type Repo interface {
// contains filtered or unexported methods
}
Repo is an interface for repositories
type Repositories ¶
type Repositories struct { BookRepository *BookRepository AuthorRepository *AuthorRepository PropertyRepository *PropertyRepository UserRepository *UserRepository }
Repositories is an interface for repositories
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
UserRepository is an interface for user repository
func NewUserRepository ¶
func NewUserRepository(pool database.ConnPool, log logger.Logger) *UserRepository
NewUserRepository creates new user repository
func (*UserRepository) GetUserByID ¶
GetUserByID get user by signin
func (*UserRepository) GetUserByUsername ¶
func (r *UserRepository) GetUserByUsername(ctx context.Context, username types.Username) (*model.User, error)
GetUserByUsername get user by username
func (*UserRepository) UpdateInfo ¶
func (r *UserRepository) UpdateInfo(ctx context.Context, user model.User, userID types.UserID) error
UpdateInfo update user
func (*UserRepository) UpdatePassword ¶
UpdatePassword update user password
func (*UserRepository) UpdateStatus ¶
UpdateStatus activate user