article

package
v0.0.0-...-d13da26 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArticleAuthorRepository

type ArticleAuthorRepository interface {
	Create(ctx context.Context, art domain.Article) (int64, error)
	Update(ctx context.Context, art domain.Article) error
}

type ArticleReaderRepository

type ArticleReaderRepository interface {
	// Save 有就更新,没有就新建,即 upsert 的语义
	Save(ctx context.Context, art domain.Article) (int64, error)
}

type ArticleRepository

type ArticleRepository interface {
	Create(ctx context.Context, art domain.Article) (int64, error)
	Update(ctx context.Context, art domain.Article) error
	// Sync 存储并同步数据
	Sync(ctx context.Context, art domain.Article) (int64, error)
	SyncStatus(ctx context.Context, id int64, author int64, status domain.ArticleStatus) error
	List(ctx context.Context, uid int64, offset int, limit int) ([]domain.Article, error)
	GetByID(ctx context.Context, id int64) (domain.Article, error)
	GetPublishedById(ctx context.Context, id int64) (domain.Article, error)
	ListPub(ctx context.Context, start time.Time, offset int, limit int) ([]domain.Article, error)
}

func NewArticleRepository

func NewArticleRepository(dao dao.ArticleDAO, l logger.LoggerV1) ArticleRepository

type CachedArticleRepository

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

func (*CachedArticleRepository) Create

func (*CachedArticleRepository) GetByID

func (*CachedArticleRepository) GetPublishedById

func (repo *CachedArticleRepository) GetPublishedById(
	ctx context.Context, id int64) (domain.Article, error)

func (*CachedArticleRepository) List

func (c *CachedArticleRepository) List(ctx context.Context, uid int64, offset int, limit int) ([]domain.Article, error)

func (*CachedArticleRepository) ListPub

func (repo *CachedArticleRepository) ListPub(ctx context.Context, start time.Time, offset int, limit int) ([]domain.Article, error)

func (*CachedArticleRepository) Sync

func (*CachedArticleRepository) SyncStatus

func (c *CachedArticleRepository) SyncStatus(ctx context.Context, id int64, author int64, status domain.ArticleStatus) error

func (*CachedArticleRepository) SyncV1

func (*CachedArticleRepository) SyncV2

SyncV2 尝试在 repository 层面上解决事务问题 确保保存到制作库和线上库同时成功,或者同时失败

func (*CachedArticleRepository) Update

Directories

Path Synopsis
Package artrepomocks is a generated GoMock package.
Package artrepomocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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