Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DefaultBucketCacheSize is a default maximum number of entries in cache. DefaultBucketCacheSize = 1e3 // DefaultBucketCacheLifetime is a default lifetime of entries in cache. DefaultBucketCacheLifetime = time.Minute )
View Source
const ( // DefaultCORSCacheSize is a default maximum number of entries in cache. DefaultCORSCacheSize = 1e3 // DefaultCORSCacheLifetime is a default lifetime of entries in cache. DefaultCORSCacheLifetime = 5 * time.Minute )
View Source
const (
DefaultNetmapCacheLifetime = time.Minute
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BucketCache ¶
type BucketCache struct {
// contains filtered or unexported fields
}
BucketCache contains cache with objects and the lifetime of cache entries.
func NewBucketCache ¶
func NewBucketCache(config *Config, cidCache bool) *BucketCache
NewBucketCache creates an object of BucketCache.
func (*BucketCache) Get ¶
func (o *BucketCache) Get(ns, bktName string) *data.BucketInfo
Get returns a cached object.
func (*BucketCache) GetByCID ¶ added in v0.33.0
func (o *BucketCache) GetByCID(cnrID cid.ID) *data.BucketInfo
func (*BucketCache) Put ¶
func (o *BucketCache) Put(bkt *data.BucketInfo) error
Put puts an object to cache.
type CORSCache ¶ added in v0.33.0
type CORSCache struct {
// contains filtered or unexported fields
}
CORSCache contains cache with CORS objects.
func NewCORSCache ¶ added in v0.33.0
NewCORSCache creates an object of CORSCache.
type Config ¶
Config stores expiration params for cache.
func DefaultBucketConfig ¶
DefaultBucketConfig returns new default cache expiration values.
func DefaultCORSConfig ¶ added in v0.33.0
DefaultCORSConfig returns new default cache expiration values.
type NetmapCache ¶ added in v0.33.0
type NetmapCache struct {
// contains filtered or unexported fields
}
NetmapCache provides cache for netmap.
func NewNetmapCache ¶ added in v0.33.0
func NewNetmapCache(config *NetmapCacheConfig) *NetmapCache
NewNetmapCache creates an object of NetmapCache.
func (*NetmapCache) Get ¶ added in v0.33.0
func (c *NetmapCache) Get() *netmap.NetMap
type NetmapCacheConfig ¶ added in v0.33.0
NetmapCacheConfig stores expiration params for cache.
func DefaultNetmapConfig ¶ added in v0.33.0
func DefaultNetmapConfig(logger *zap.Logger) *NetmapCacheConfig
DefaultNetmapConfig returns new default cache expiration values.
Click to show internal directories.
Click to hide internal directories.