mysql

package
v0.0.0-...-9f87b0a Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArticleRepository

type ArticleRepository struct {
	Conn *sql.DB
}

func NewArticleRepository

func NewArticleRepository(conn *sql.DB) *ArticleRepository

NewArticleRepository will create an object that represent the article.Repository interface

func (*ArticleRepository) Delete

func (m *ArticleRepository) Delete(ctx context.Context, id int64) (err error)

func (*ArticleRepository) Fetch

func (m *ArticleRepository) Fetch(ctx context.Context, cursor string, num int64) (res []domain.Article, nextCursor string, err error)

func (*ArticleRepository) GetByID

func (m *ArticleRepository) GetByID(ctx context.Context, id int64) (res domain.Article, err error)

func (*ArticleRepository) GetByTitle

func (m *ArticleRepository) GetByTitle(ctx context.Context, title string) (res domain.Article, err error)

func (*ArticleRepository) Store

func (m *ArticleRepository) Store(ctx context.Context, a *domain.Article) (err error)

func (*ArticleRepository) Update

func (m *ArticleRepository) Update(ctx context.Context, ar *domain.Article) (err error)

type AuthorRepository

type AuthorRepository struct {
	DB *sql.DB
}

func NewAuthorRepository

func NewAuthorRepository(db *sql.DB) *AuthorRepository

NewMysqlAuthorRepository will create an implementation of author.Repository

func (*AuthorRepository) GetByID

func (m *AuthorRepository) GetByID(ctx context.Context, id int64) (domain.Author, error)

Jump to

Keyboard shortcuts

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