cache

package
v2.13.3 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 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 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 It, and the interfaces derived from it, are currently being used for building caches around go-micro stores, encoding the data in the messsagepack format.

type Config added in v2.13.0

type Config struct {
	Store    string   `mapstructure:"cache_store"`
	Nodes    []string `mapstructure:"cache_nodes"`
	Database string   `mapstructure:"cache_database"`
	Table    string   `mapstructure:"cache_table"`
	TTL      int      `mapstructure:"cache_ttl"`
	Size     int      `mapstructure:"cache_size"`
}

Config contains the configuring for a cache

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, size int) 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, size int) CreateHomeCache

NewCreateHomeCache creates a new CreateHomeCache

type CreatePersonalSpaceCache added in v2.13.0

type CreatePersonalSpaceCache interface {
	Cache
	GetKey(userID *userpb.UserId) string
}

CreatePersonalSpaceCache handles removing keys from a create home cache

func GetCreatePersonalSpaceCache added in v2.13.0

func GetCreatePersonalSpaceCache(cacheStore string, cacheNodes []string, database, table string, ttl time.Duration, size int) CreatePersonalSpaceCache

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

func NewCreatePersonalSpaceCache added in v2.13.0

func NewCreatePersonalSpaceCache(store string, nodes []string, database, table string, ttl time.Duration, size int) CreatePersonalSpaceCache

NewCreatePersonalSpaceCache creates a new CreatePersonalSpaceCache

type FileMetadataCache added in v2.13.0

type FileMetadataCache interface {
	Cache
	RemoveMetadata(path string) error
}

FileMetadataCache handles file metadata

func GetFileMetadataCache added in v2.13.0

func GetFileMetadataCache(cacheStore string, cacheNodes []string, database, table string, ttl time.Duration, size int) FileMetadataCache

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

func NewFileMetadataCache added in v2.13.0

func NewFileMetadataCache(store string, nodes []string, database, table string, ttl time.Duration, size int) FileMetadataCache

NewFileMetadataCache creates a new FileMetadataCache

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, size int) 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, size int) 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, size int) 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, size int) StatCache

NewStatCache creates a new StatCache

Jump to

Keyboard shortcuts

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