Versions in this module Expand all Collapse all v1 v1.0.0 Nov 16, 2023 Changes in this version + func NewMysqlDB(cfg Config) (*sql.DB, error) + type Author interface + AddAuthor func(author book.Author) (book.Responce, error) + GetAuthor func(bookTitle string) (book.Author, error) + type AuthorMysql struct + func NewAuthorMysql(db *sql.DB) *AuthorMysql + func (r *AuthorMysql) AddAuthor(author book.Author) (book.Responce, error) + func (r *AuthorMysql) GetAuthor(bookTitle string) (book.Author, error) + type Book interface + AddBook func(book book.Book) (book.Responce, error) + GetBooks func(author book.Author) ([]book.Book, error) + type BookMysql struct + func NewBookMysql(db *sql.DB) *BookMysql + func (r *BookMysql) AddBook(bk book.Book) (book.Responce, error) + func (r *BookMysql) GetBooks(author book.Author) ([]book.Book, error) + type Config struct + DBName string + Host string + Password string + Port string + Username string + type Repository struct + func NewRepository(db *sql.DB) *Repository