cache

package
v2.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 12 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 interface {
	PullFromCache(key string, dest interface{}) error
	PushToCache(key string, src interface{}) error
	List(opts ...microstore.ListOption) ([]string, error)
	Delete(key string, opts ...microstore.DeleteOption) error
	Close() error
}

Cache handles key value operations on caches

func NewCache

func NewCache(store string, nodes []string, database, table string, ttl time.Duration) Cache

NewCache initializes a new CacheStore

type CreateHomeCache

type CreateHomeCache interface {
	Cache
	RemoveCreateHome(res *provider.ResourceId)
	GetKey(userID *userpb.UserId) string
}

CreateHomeCache handles removing keys from a create home cache

func GetCreateHomeCache

func GetCreateHomeCache(cacheStore string, cacheNodes []string, database, table string, ttl time.Duration) CreateHomeCache

GetCreateHomeCache will return an existing CreateHomeCache for the given store, nodes, database and table If it does not exist yet it will be created, different TTLs are ignored

func NewCreateHomeCache

func NewCreateHomeCache(store string, nodes []string, database, table string, ttl time.Duration) CreateHomeCache

NewCreateHomeCache creates a new CreateHomeCache

type ProviderCache

type ProviderCache interface {
	Cache
	RemoveListStorageProviders(res *provider.ResourceId)
	GetKey(userID *userpb.UserId, spaceID string) string
}

ProviderCache handles removing keys from a storage provider cache

func GetProviderCache

func GetProviderCache(cacheStore string, cacheNodes []string, database, table string, ttl time.Duration) ProviderCache

GetProviderCache will return an existing ProviderCache for the given store, nodes, database and table If it does not exist yet it will be created, different TTLs are ignored

func NewProviderCache

func NewProviderCache(store string, nodes []string, database, table string, ttl time.Duration) ProviderCache

NewProviderCache creates a new ProviderCache

type StatCache

type StatCache interface {
	Cache
	RemoveStat(userID *userpb.UserId, res *provider.ResourceId)
	GetKey(userID *userpb.UserId, ref *provider.Reference, metaDataKeys, fieldMaskPaths []string) string
}

StatCache handles removing keys from a stat cache

func GetStatCache

func GetStatCache(cacheStore string, cacheNodes []string, database, table string, ttl time.Duration) StatCache

GetStatCache will return an existing StatCache for the given store, nodes, database and table If it does not exist yet it will be created, different TTLs are ignored

func NewStatCache

func NewStatCache(store string, nodes []string, database, table string, ttl time.Duration) StatCache

NewStatCache creates a new StatCache

Jump to

Keyboard shortcuts

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