repository

package
v0.0.0-...-bda6635 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository struct {
	DB *sqlx.DB
}

func NewRepository

func NewRepository(db *sqlx.DB) Repository

func (Repository) CreateUser

func (r Repository) CreateUser(user models.User, ctx context.Context) error

func (Repository) DeletePost

func (r Repository) DeletePost(id int, c context.Context) error

func (Repository) DeleteTag

func (r Repository) DeleteTag(id int, ctx context.Context) error

func (Repository) FindAllPost

func (r Repository) FindAllPost(c context.Context) ([]*models.Post, error)

func (Repository) FindAllTag

func (r Repository) FindAllTag(ctx context.Context) ([]*models.Tag, error)

func (*Repository) FindPostById

func (r *Repository) FindPostById(id int, c context.Context) (*models.Post, error)

func (*Repository) FindTagById

func (r *Repository) FindTagById(id int, ctx context.Context) (*models.Tag, error)

func (Repository) InsertPost

func (r Repository) InsertPost(post models.Post, c context.Context) error

func (Repository) InsertTag

func (r Repository) InsertTag(tag models.Tag, ctx context.Context) error

func (Repository) UpdatePost

func (r Repository) UpdatePost(post models.Post, c context.Context) error

func (Repository) UpdateTag

func (r Repository) UpdateTag(tag models.Tag, ctx context.Context) error

Jump to

Keyboard shortcuts

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