repository

package
v0.0.0-...-6852176 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 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 ArticleItem

type ArticleItem interface {
	Create(userId int, art models.Article) (int, error)
	Delete(userId, articleId int) error
	Update(userId, articleId int, upArt models.UpdateArticle) error
	SelectAll(userId int) ([]models.Article, error)
	Get(userId, articleId int) (models.Article, error)
}

type ArticlePostgres

type ArticlePostgres struct {
	// contains filtered or unexported fields
}

func NewArticlePostgres

func NewArticlePostgres(db *sqlx.DB) *ArticlePostgres

func (*ArticlePostgres) Create

func (a *ArticlePostgres) Create(userId int, art models.Article) (int, error)

func (*ArticlePostgres) Delete

func (a *ArticlePostgres) Delete(userId, articleId int) error

func (*ArticlePostgres) Get

func (a *ArticlePostgres) Get(userId, articleId int) (models.Article, error)

func (*ArticlePostgres) SelectAll

func (a *ArticlePostgres) SelectAll(userId int) ([]models.Article, error)

func (*ArticlePostgres) Update

func (a *ArticlePostgres) Update(userId, articleId int, upArt models.UpdateArticle) error

type Auth

type Auth struct {
	// contains filtered or unexported fields
}

func NewAuth

func NewAuth(db *sqlx.DB) *Auth

func (*Auth) CreateUser

func (a *Auth) CreateUser(usr models.User) (int, error)

func (*Auth) GetUser

func (a *Auth) GetUser(email, password string) (models.User, error)

type Authorization

type Authorization interface {
	CreateUser(user models.User) (int, error)
	GetUser(email, password string) (models.User, error)
}

type Repository

type Repository struct {
	Authorization
	ArticleItem
}

func NewRepository

func NewRepository(db *sqlx.DB) *Repository

Jump to

Keyboard shortcuts

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