Documentation ¶
Index ¶
- func NewPostgresDB(cfg Config) (*sqlx.DB, error)
- type AuthPostgres
- type Authorization
- type Comment
- type CommentPostgres
- func (r *CommentPostgres) Create(idUser int, comment common.Comment) (int, error)
- func (r *CommentPostgres) Delete(idUser, commentId int) error
- func (r *CommentPostgres) GetAll(idUser int) ([]common.Comment, error)
- func (r *CommentPostgres) GetById(idUser, commentId int) (common.Comment, error)
- func (r *CommentPostgres) Update(idUser, commentId int, input common.UpdateCommentInput) error
- type Config
- type Repository
- type User
- type UserPostgres
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthPostgres ¶
type AuthPostgres struct {
// contains filtered or unexported fields
}
func NewAuthPostgres ¶
func NewAuthPostgres(db *sqlx.DB) *AuthPostgres
func (*AuthPostgres) CreateUser ¶
func (r *AuthPostgres) CreateUser(user common.User) (int, error)
func (*AuthPostgres) GetUser ¶
func (r *AuthPostgres) GetUser(username, password string) (common.User, error)
type Authorization ¶
type CommentPostgres ¶
type CommentPostgres struct {
// contains filtered or unexported fields
}
func NewCommentPostgres ¶
func NewCommentPostgres(db *sqlx.DB) *CommentPostgres
func (*CommentPostgres) Delete ¶
func (r *CommentPostgres) Delete(idUser, commentId int) error
func (*CommentPostgres) GetAll ¶
func (r *CommentPostgres) GetAll(idUser int) ([]common.Comment, error)
func (*CommentPostgres) GetById ¶
func (r *CommentPostgres) GetById(idUser, commentId int) (common.Comment, error)
func (*CommentPostgres) Update ¶
func (r *CommentPostgres) Update(idUser, commentId int, input common.UpdateCommentInput) error
type Repository ¶
type Repository struct { Authorization Comment User }
func NewRepository ¶
func NewRepository(db *sqlx.DB) *Repository
type UserPostgres ¶
type UserPostgres struct {
// contains filtered or unexported fields
}
func NewUserPostgres ¶
func NewUserPostgres(db *sqlx.DB) *UserPostgres
func (*UserPostgres) Delete ¶
func (r *UserPostgres) Delete(id int) error
func (*UserPostgres) Update ¶
func (r *UserPostgres) Update(id int, input common.UpdateUserInput) error
Click to show internal directories.
Click to hide internal directories.