cache

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 8 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 agency cache.

func New

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

New to create new agency cache.

func (*Cache) GetAll

func (c *Cache) GetAll(ctx context.Context, req entity.GetAllRequest) (_ []entity.Agency, _ int, code int, err error)

GetAll to get all.

func (*Cache) GetAllIDs

func (c *Cache) GetAllIDs(ctx context.Context) (data []int64, code int, err error)

GetAllIDs to get all ids.

func (*Cache) GetByID added in v0.8.0

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

GetByID to get by id.

func (*Cache) GetCount added in v0.14.0

func (c *Cache) GetCount(ctx context.Context) (data int, code int, err error)

GetCount to get count.

func (*Cache) GetOldIDs

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

GetOldIDs to get old ids.

func (*Cache) IsOld

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

IsOld to check if old.

func (*Cache) UpdateByID

func (c *Cache) UpdateByID(ctx context.Context, id int64, data entity.Agency) (int, error)

UpdateByID to update by id.

Jump to

Keyboard shortcuts

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