redipo

package module
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

README

PkgGoDev Go Report Card Total alerts

Redipo

Why only use Redis for caching? Let's store all of our data on it!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

func (*Manager) LoadDbRepo added in v0.1.7

func (m *Manager) LoadDbRepo(name string) RepoInterface

func (*Manager) LoadRepo

func (m *Manager) LoadRepo(name string) RepoInterface

type ManagerInterface

type ManagerInterface interface {
	LoadRepo(name string) RepoInterface
	LoadDbRepo(name string) RepoInterface
	// contains filtered or unexported methods
}

func New

func New() ManagerInterface

type Repo

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

func (*Repo) AddToIndex

func (r *Repo) AddToIndex(name string, id uuid.UUID) error

func (*Repo) CleanupInvalidKeys added in v0.1.5

func (r *Repo) CleanupInvalidKeys(dryRun bool) ([]uuid.UUID, error)

func (*Repo) ClearIndex added in v0.1.7

func (r *Repo) ClearIndex(name string) error

func (*Repo) Delete

func (r *Repo) Delete(id uuid.UUID) error

func (*Repo) DeleteIndex added in v0.1.8

func (r *Repo) DeleteIndex(name string) error

func (*Repo) Get

func (r *Repo) Get(id uuid.UUID) (interface{}, error)

func (*Repo) GetAll

func (r *Repo) GetAll() ([]interface{}, error)

func (*Repo) GetIndex

func (r *Repo) GetIndex(name string) ([]uuid.UUID, error)

func (*Repo) List

func (r *Repo) List() ([]uuid.UUID, error)

func (*Repo) RemoveFromIndex

func (r *Repo) RemoveFromIndex(name string, id uuid.UUID) error

func (*Repo) Save

func (r *Repo) Save(id uuid.UUID, value interface{}) error

func (*Repo) SaveWithExpiration added in v0.1.9

func (r *Repo) SaveWithExpiration(id uuid.UUID, value interface{}, expiration time.Duration) error

func (*Repo) SetCaching added in v0.1.2

func (r *Repo) SetCaching(cacheInstance cache.Cache) RepoInterface

func (*Repo) SetFactory

func (r *Repo) SetFactory(factory func() interface{})

type RepoInterface

type RepoInterface interface {
	SetCaching(cacheInstance cache.Cache) RepoInterface
	SetFactory(func() interface{})
	List() ([]uuid.UUID, error)
	Get(id uuid.UUID) (interface{}, error)
	GetAll() ([]interface{}, error)
	GetIndex(name string) ([]uuid.UUID, error)
	AddToIndex(name string, id uuid.UUID) error
	RemoveFromIndex(name string, id uuid.UUID) error
	DeleteIndex(name string) error
	Save(id uuid.UUID, value interface{}) error
	SaveWithExpiration(id uuid.UUID, value interface{}, expiration time.Duration) error
	Delete(id uuid.UUID) error
	CleanupInvalidKeys(dryRun bool) ([]uuid.UUID, error)
}

func NewRepo

func NewRepo(name string, client *redis.Client) RepoInterface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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