repository

package
v0.0.0-...-80d63af Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

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

func (r *AuthorRepository) DeleteAuthor(ctx context.Context, authorID types.ID) error

DeleteAuthor deletes author

func (*AuthorRepository) GetAuthor

func (r *AuthorRepository) GetAuthor(ctx context.Context, authorID types.ID) (*model.Author, error)

GetAuthor returns author by id

func (*AuthorRepository) GetAuthors

func (r *AuthorRepository) GetAuthors(ctx context.Context) ([]model.Author, error)

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

func (r *BookRepository) CreateBook(ctx context.Context, book *model.Book) (*model.Book, error)

CreateBook create book

func (*BookRepository) DeleteBook

func (r *BookRepository) DeleteBook(ctx context.Context, bookID types.ID) error

DeleteBook delete book by ID

func (*BookRepository) GetBook

func (r *BookRepository) GetBook(ctx context.Context, bookID types.ID) (*model.Book, error)

GetBook get book by ID

func (*BookRepository) GetBooks

func (r *BookRepository) GetBooks(ctx context.Context) ([]model.Book, error)

GetBooks get list of books

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

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) Create

func (r *UserRepository) Create(ctx context.Context, input model.User) (*model.User, error)

Create create user

func (*UserRepository) GetUserByID

func (r *UserRepository) GetUserByID(ctx context.Context, userID types.UserID) (*model.User, error)

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

func (r *UserRepository) UpdatePassword(ctx context.Context, user model.User) error

UpdatePassword update user password

func (*UserRepository) UpdateStatus

func (r *UserRepository) UpdateStatus(ctx context.Context, user model.User) error

UpdateStatus activate user

Jump to

Keyboard shortcuts

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