redis

package
v0.0.0-...-66c98c8 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 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 CachedManager

type CachedManager interface {
	// Manager is the raw resource Manager.
	repository.Manager
	// Manager is the common interface for resource cache.
	cached.Manager
}

CachedManager is the interface combines raw resource Manager and cached Manager for better extension.

type Manager

type Manager struct {
	*cached.BaseManager
	// contains filtered or unexported fields
}

Manager is the cached manager implemented by redis.

func NewManager

func NewManager(m repository.Manager) *Manager

NewManager returns the redis cache manager.

func (*Manager) AddPullCount

func (m *Manager) AddPullCount(ctx context.Context, id int64, count uint64) error

func (*Manager) Count

func (m *Manager) Count(ctx context.Context, query *q.Query) (int64, error)

func (*Manager) Create

func (m *Manager) Create(ctx context.Context, repo *model.RepoRecord) (int64, error)

func (*Manager) Delete

func (m *Manager) Delete(ctx context.Context, id int64) error

func (*Manager) Get

func (m *Manager) Get(ctx context.Context, id int64) (*model.RepoRecord, error)

func (*Manager) GetByName

func (m *Manager) GetByName(ctx context.Context, name string) (*model.RepoRecord, error)

func (*Manager) List

func (m *Manager) List(ctx context.Context, query *q.Query) ([]*model.RepoRecord, error)

func (*Manager) NonEmptyRepos

func (m *Manager) NonEmptyRepos(ctx context.Context) ([]*model.RepoRecord, error)

func (*Manager) Update

func (m *Manager) Update(ctx context.Context, repo *model.RepoRecord, props ...string) error

Jump to

Keyboard shortcuts

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