cache

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache contains functions for anime cache.

func New

func New(cacher cache.Cacher, repo repository.Repository) *Cache

New to create new anime cache.

func (*Cache) DeleteByID added in v0.3.2

func (c *Cache) DeleteByID(ctx context.Context, id int64) (int, error)

DeleteByID to delete by id.

func (*Cache) Get added in v0.9.0

func (c *Cache) Get(ctx context.Context, data entity.GetRequest) ([]*entity.Anime, int, int, error)

Get to get anime list.

func (*Cache) GetByID

func (c *Cache) GetByID(ctx context.Context, id int64) (data *entity.Anime, code int, err error)

GetByID to get anime by id.

func (*Cache) GetByIDs

func (c *Cache) GetByIDs(ctx context.Context, ids []int64) ([]*entity.Anime, int, error)

GetByIDs to get anime by ids.

func (*Cache) GetHistories added in v0.9.0

func (c *Cache) GetHistories(ctx context.Context, data entity.GetHistoriesRequest) ([]entity.History, int, error)

GetHistories to get histories.

func (*Cache) GetIDs

func (c *Cache) GetIDs(ctx context.Context) ([]int64, int, error)

GetIDs to get all ids.

func (*Cache) GetMaxID

func (c *Cache) GetMaxID(ctx context.Context) (int64, int, error)

GetMaxID to get max id.

func (*Cache) GetOldFinishedIDs

func (c *Cache) GetOldFinishedIDs(ctx context.Context) ([]int64, int, error)

GetOldFinishedIDs to get old finished anime ids.

func (*Cache) GetOldNotYetIDs

func (c *Cache) GetOldNotYetIDs(ctx context.Context) ([]int64, int, error)

GetOldNotYetIDs to get old not yet released anime ids.

func (*Cache) GetOldReleasingIDs

func (c *Cache) GetOldReleasingIDs(ctx context.Context) ([]int64, int, error)

GetOldReleasingIDs to get old releasing anime ids.

func (*Cache) GetRelatedByIDs added in v0.3.0

func (c *Cache) GetRelatedByIDs(ctx context.Context, ids []int64) ([]*entity.AnimeRelated, int, error)

GetRelatedByIDs to get related by ids.

func (*Cache) IsOld

func (c *Cache) IsOld(ctx context.Context, id int64) (bool, int, error)

IsOld to check if old.

func (*Cache) Update

func (c *Cache) Update(ctx context.Context, data entity.Anime) (int, error)

Update to update data.

Jump to

Keyboard shortcuts

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