Documentation ¶
Index ¶
- Constants
- type AccessBoxCache
- type AccessControlCache
- type BucketCache
- type Config
- func DefaultAccessBoxConfig(logger *zap.Logger) *Config
- func DefaultAccessControlConfig(logger *zap.Logger) *Config
- func DefaultBucketConfig(logger *zap.Logger) *Config
- func DefaultObjectsConfig(logger *zap.Logger) *Config
- func DefaultObjectsListConfig(logger *zap.Logger) *Config
- func DefaultObjectsNameConfig(logger *zap.Logger) *Config
- func DefaultSystemConfig(logger *zap.Logger) *Config
- type ObjectsCache
- type ObjectsListCache
- type ObjectsListKey
- type ObjectsNameCache
- type SystemCache
- func (o *SystemCache) Delete(key string) bool
- func (o *SystemCache) GetCORS(key string) *data.CORSConfiguration
- func (o *SystemCache) GetLockInfo(key string) *data.LockInfo
- func (o *SystemCache) GetNotificationConfiguration(key string) *data.NotificationConfiguration
- func (o *SystemCache) GetObject(key string) *data.ObjectInfo
- func (o *SystemCache) GetSettings(key string) *data.BucketSettings
- func (o *SystemCache) GetTagging(key string) map[string]string
- func (o *SystemCache) PutCORS(key string, obj *data.CORSConfiguration) error
- func (o *SystemCache) PutLockInfo(key string, lockInfo *data.LockInfo) error
- func (o *SystemCache) PutNotificationConfiguration(key string, obj *data.NotificationConfiguration) error
- func (o *SystemCache) PutObject(key string, obj *data.ObjectInfo) error
- func (o *SystemCache) PutSettings(key string, settings *data.BucketSettings) error
- func (o *SystemCache) PutTagging(key string, tagSet map[string]string) error
Constants ¶
const ( // DefaultAccessControlCacheLifetime is a default lifetime of entries in access' cache. DefaultAccessControlCacheLifetime = 1 * time.Minute // DefaultAccessControlCacheSize is a default maximum number of entries in access' cache. DefaultAccessControlCacheSize = 1e5 )
const ( // DefaultAccessBoxCacheSize is a default maximum number of entries in cache. DefaultAccessBoxCacheSize = 100 // DefaultAccessBoxCacheLifetime is a default lifetime of entries in cache. DefaultAccessBoxCacheLifetime = 10 * time.Minute )
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 )
const ( // DefaultObjectsNameCacheSize is a default maximum number of entries in cache. DefaultObjectsNameCacheSize = 1e4 // DefaultObjectsNameCacheLifetime is a default lifetime of entries in cache. DefaultObjectsNameCacheLifetime = time.Minute )
const ( // DefaultObjectsCacheLifetime is a default lifetime of entries in objects' cache. DefaultObjectsCacheLifetime = time.Minute * 5 // DefaultObjectsCacheSize is a default maximum number of entries in objects' cache. DefaultObjectsCacheSize = 1e6 )
const ( // DefaultObjectsListCacheLifetime is a default lifetime of entries in cache of ListObjects. DefaultObjectsListCacheLifetime = time.Second * 60 // DefaultObjectsListCacheSize is a default size of cache of ListObjects. DefaultObjectsListCacheSize = 1e5 )
const ( // DefaultSystemCacheSize is a default maximum number of entries in cache. DefaultSystemCacheSize = 1e4 // DefaultSystemCacheLifetime is a default lifetime of entries in cache. DefaultSystemCacheLifetime = 5 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessBoxCache ¶
type AccessBoxCache struct {
// contains filtered or unexported fields
}
AccessBoxCache stores an access box by its address.
func NewAccessBoxCache ¶
func NewAccessBoxCache(config *Config) *AccessBoxCache
NewAccessBoxCache creates an object of BucketCache.
type AccessControlCache ¶
type AccessControlCache struct {
// contains filtered or unexported fields
}
AccessControlCache provides lru cache for objects.
func NewAccessControlCache ¶
func NewAccessControlCache(config *Config) *AccessControlCache
NewAccessControlCache creates an object of AccessControlCache.
func (*AccessControlCache) Delete ¶
func (o *AccessControlCache) Delete(owner user.ID, key string) bool
Delete deletes an object from cache.
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) *BucketCache
NewBucketCache creates an object of BucketCache.
func (*BucketCache) Delete ¶
func (o *BucketCache) Delete(key string) bool
Delete deletes an object from cache.
func (*BucketCache) Get ¶
func (o *BucketCache) Get(key string) *data.BucketInfo
Get returns a cached object.
func (*BucketCache) Put ¶
func (o *BucketCache) Put(bkt *data.BucketInfo) error
Put puts an object to cache.
type Config ¶
Config stores expiration params for cache.
func DefaultAccessBoxConfig ¶
DefaultAccessBoxConfig returns new default cache expiration values.
func DefaultAccessControlConfig ¶
DefaultAccessControlConfig returns new default cache expiration values.
func DefaultBucketConfig ¶
DefaultBucketConfig returns new default cache expiration values.
func DefaultObjectsConfig ¶
DefaultObjectsConfig returns new default cache expiration values.
func DefaultObjectsListConfig ¶
DefaultObjectsListConfig returns new default cache expiration values.
func DefaultObjectsNameConfig ¶
DefaultObjectsNameConfig returns new default cache expiration values.
func DefaultSystemConfig ¶
DefaultSystemConfig returns new default cache expiration values.
type ObjectsCache ¶
type ObjectsCache struct {
// contains filtered or unexported fields
}
ObjectsCache provides lru cache for objects.
func (*ObjectsCache) Delete ¶
func (o *ObjectsCache) Delete(address oid.Address) bool
Delete deletes an object from cache.
func (*ObjectsCache) GetObject ¶
func (o *ObjectsCache) GetObject(address oid.Address) *data.ExtendedObjectInfo
GetObject returns a cached object info.
func (*ObjectsCache) PutObject ¶
func (o *ObjectsCache) PutObject(obj *data.ExtendedObjectInfo) error
PutObject puts an object info to cache.
type ObjectsListCache ¶
type ObjectsListCache struct {
// contains filtered or unexported fields
}
ObjectsListCache contains cache for ListObjects and ListObjectVersions.
func NewObjectsListCache ¶
func NewObjectsListCache(config *Config) *ObjectsListCache
NewObjectsListCache is a constructor which creates an object of ListObjectsCache with the given lifetime of entries.
func (*ObjectsListCache) CleanCacheEntriesContainingObject ¶
func (l *ObjectsListCache) CleanCacheEntriesContainingObject(objectName string, cnr cid.ID)
CleanCacheEntriesContainingObject deletes entries containing specified object.
func (*ObjectsListCache) GetVersions ¶
func (l *ObjectsListCache) GetVersions(key ObjectsListKey) []*data.NodeVersion
GetVersions returns a list of ObjectInfo.
func (*ObjectsListCache) PutVersions ¶
func (l *ObjectsListCache) PutVersions(key ObjectsListKey, versions []*data.NodeVersion) error
PutVersions puts a list of object versions to cache.
type ObjectsListKey ¶
type ObjectsListKey struct {
// contains filtered or unexported fields
}
ObjectsListKey is a key to find a ObjectsListCache's entry.
func CreateObjectsListCacheKey ¶
func CreateObjectsListCacheKey(cnr cid.ID, prefix string, latestOnly bool) ObjectsListKey
CreateObjectsListCacheKey returns ObjectsListKey with the given CID, prefix and latestOnly flag.
func (*ObjectsListKey) String ¶
func (k *ObjectsListKey) String() string
type ObjectsNameCache ¶
type ObjectsNameCache struct {
// contains filtered or unexported fields
}
ObjectsNameCache provides lru cache for objects. This cache contains mapping nice names to object addresses. Key is bucketName+objectName.
func NewObjectsNameCache ¶
func NewObjectsNameCache(config *Config) *ObjectsNameCache
NewObjectsNameCache creates an object of ObjectsNameCache.
func (*ObjectsNameCache) Delete ¶
func (o *ObjectsNameCache) Delete(key string) bool
Delete deletes an object from cache.
type SystemCache ¶
type SystemCache struct {
// contains filtered or unexported fields
}
SystemCache provides lru cache for objects. This cache contains "system" objects (bucket versioning settings, tagging object etc.). Key is bucketName+systemFilePath.
func NewSystemCache ¶
func NewSystemCache(config *Config) *SystemCache
NewSystemCache creates an object of SystemCache.
func (*SystemCache) Delete ¶
func (o *SystemCache) Delete(key string) bool
Delete deletes an object from cache.
func (*SystemCache) GetCORS ¶
func (o *SystemCache) GetCORS(key string) *data.CORSConfiguration
func (*SystemCache) GetLockInfo ¶
func (o *SystemCache) GetLockInfo(key string) *data.LockInfo
GetLockInfo returns a cached object.
func (*SystemCache) GetNotificationConfiguration ¶
func (o *SystemCache) GetNotificationConfiguration(key string) *data.NotificationConfiguration
func (*SystemCache) GetObject ¶
func (o *SystemCache) GetObject(key string) *data.ObjectInfo
GetObject returns a cached object.
func (*SystemCache) GetSettings ¶
func (o *SystemCache) GetSettings(key string) *data.BucketSettings
func (*SystemCache) GetTagging ¶
func (o *SystemCache) GetTagging(key string) map[string]string
GetTagging returns tags of a bucket or an object.
func (*SystemCache) PutCORS ¶
func (o *SystemCache) PutCORS(key string, obj *data.CORSConfiguration) error
func (*SystemCache) PutLockInfo ¶
func (o *SystemCache) PutLockInfo(key string, lockInfo *data.LockInfo) error
PutLockInfo puts an object to cache.
func (*SystemCache) PutNotificationConfiguration ¶
func (o *SystemCache) PutNotificationConfiguration(key string, obj *data.NotificationConfiguration) error
func (*SystemCache) PutObject ¶
func (o *SystemCache) PutObject(key string, obj *data.ObjectInfo) error
PutObject puts an object to cache.
func (*SystemCache) PutSettings ¶
func (o *SystemCache) PutSettings(key string, settings *data.BucketSettings) error
func (*SystemCache) PutTagging ¶
func (o *SystemCache) PutTagging(key string, tagSet map[string]string) error
PutTagging puts tags of a bucket or an object.