cache

package
v0.0.0-...-4cccb1b Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LangRepo

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

func NewLangRepo

func NewLangRepo(ctx context.Context, domainProxy lang.Repository, queryProxy query.LangViewRepository, opts Opts) *LangRepo

func (LangRepo) Create

func (l LangRepo) Create(ln *lang.Lang) error

func (LangRepo) Delete

func (l LangRepo) Delete(id, authorID string) error

func (LangRepo) DeleteByAuthorID

func (l LangRepo) DeleteByAuthorID(authorID string) (int, error)

func (LangRepo) Exist

func (l LangRepo) Exist(id, authorID string) (bool, error)

func (LangRepo) Get

func (l LangRepo) Get(id, authorID string) (*lang.Lang, error)

func (LangRepo) GetAllViews

func (l LangRepo) GetAllViews(authorID string) ([]query.LangView, error)

func (LangRepo) GetView

func (l LangRepo) GetView(id, authorID string) (query.LangView, error)

func (LangRepo) Update

func (l LangRepo) Update(ln *lang.Lang) error

type Opts

type Opts struct {
	TagCacheTTL                time.Duration
	TranslationCacheTTL        time.Duration
	TranslationsSearchCacheTTL time.Duration
	LangCacheTTL               time.Duration
}

type TagRepo

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

func NewTagRepo

func NewTagRepo(ctx context.Context, domainProxy tag.Repository, queryProxy query.TagViewRepository, opts Opts) *TagRepo

func (TagRepo) AllExist

func (t TagRepo) AllExist(ids []string, authorID string) (bool, error)

func (TagRepo) Create

func (t TagRepo) Create(tg *tag.Tag) error

func (TagRepo) Delete

func (t TagRepo) Delete(id, authorID string) error

func (TagRepo) DeleteByAuthorID

func (t TagRepo) DeleteByAuthorID(authorID string) (int, error)

func (TagRepo) Get

func (t TagRepo) Get(id, authorID string) (*tag.Tag, error)

func (TagRepo) GetAllViews

func (t TagRepo) GetAllViews(authorID string) ([]query.TagView, error)

func (TagRepo) GetView

func (t TagRepo) GetView(id, authorID string) (query.TagView, error)

func (TagRepo) GetViews

func (t TagRepo) GetViews(ids []string, authorID string) ([]query.TagView, error)

func (TagRepo) Update

func (t TagRepo) Update(tg *tag.Tag) error

type TranslationRepo

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

func NewTranslationRepo

func NewTranslationRepo(ctx context.Context, domainProxy translation.Repository, queryProxy query.TranslationViewRepository, cacheTTL time.Duration) *TranslationRepo

func (*TranslationRepo) Create

func (t *TranslationRepo) Create(record *translation.Translation) error

func (*TranslationRepo) Delete

func (t *TranslationRepo) Delete(id, authorID string) error

func (*TranslationRepo) DeleteByAuthorID

func (t *TranslationRepo) DeleteByAuthorID(authorID string) (int, error)

func (*TranslationRepo) ExistByLang

func (t *TranslationRepo) ExistByLang(langID, authorID string) (bool, error)

func (*TranslationRepo) ExistByTag

func (t *TranslationRepo) ExistByTag(tagID, authorID string) (bool, error)

func (*TranslationRepo) Get

func (t *TranslationRepo) Get(id, authorID string) (*translation.Translation, error)

func (*TranslationRepo) GetLastViewsBySourcePart

func (t *TranslationRepo) GetLastViewsBySourcePart(authorID, langID, sourcePart string, pageSize, page int) (query.LastTranslationViews, error)

func (*TranslationRepo) GetLastViewsByTags

func (t *TranslationRepo) GetLastViewsByTags(authorID, langID string, pageSize, page int, tagIds []string) (query.LastTranslationViews, error)

func (*TranslationRepo) GetLastViewsByTargetPart

func (t *TranslationRepo) GetLastViewsByTargetPart(authorID, langID, targetPart string, pageSize, page int) (query.LastTranslationViews, error)

func (*TranslationRepo) GetRandomViews

func (t *TranslationRepo) GetRandomViews(authorID, langID string, tagIds []string, limit int) (query.RandomViews, error)

func (*TranslationRepo) GetView

func (t *TranslationRepo) GetView(id, authorID string) (query.TranslationView, error)

func (*TranslationRepo) Update

func (t *TranslationRepo) Update(record *translation.Translation) error

Jump to

Keyboard shortcuts

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