news

package
v0.0.0-...-7efed30 Latest Latest
Warning

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

Go to latest
Published: May 15, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNewsNotFound = errors.Wrap(errors.ErrNotFound, "news are not found")

	ErrNewsAlreadyExist = errors.Wrap(errors.ErrForbidden, "news already exist")

	ErrNoReference = errors.Wrap(errors.ErrNotFound, "writer is not found")

	ErrToAddNewsLabel = errors.Wrap(errors.ErrInternal, "add news label")
)

Functions

This section is empty.

Types

type NewsRepo

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

func New

func New(db *sqlx.DB) *NewsRepo

func (*NewsRepo) CreateNews

func (n *NewsRepo) CreateNews(ctx context.Context, args model.News) (model.News, error)

func (*NewsRepo) DeleteNews

func (n *NewsRepo) DeleteNews(ctx context.Context, id int64) error

func (*NewsRepo) GetNews

func (n *NewsRepo) GetNews(ctx context.Context, id int64) (model.News, error)

func (*NewsRepo) ListNews

func (n *NewsRepo) ListNews(ctx context.Context) ([]model.News, error)

func (*NewsRepo) UpdateNews

func (n *NewsRepo) UpdateNews(ctx context.Context, args model.News) (model.News, error)

Jump to

Keyboard shortcuts

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