forked from TrueCloudLab/frostfs-s3-gw
[#165] Support streaming listing
Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
This commit is contained in:
parent
84af85ed67
commit
29ac91dfd5
12 changed files with 938 additions and 39 deletions
|
@ -1,6 +1,8 @@
|
|||
package layer
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/cache"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/data"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-s3-gw/internal/logs"
|
||||
|
@ -10,7 +12,15 @@ import (
|
|||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type TestCacheValue struct {
|
||||
Next *data.ObjectInfo
|
||||
Stream LatestVersionsByPrefixStream
|
||||
NamesMap map[string]struct{}
|
||||
Context context.Context
|
||||
}
|
||||
|
||||
type Cache struct {
|
||||
testCache map[string]TestCacheValue
|
||||
logger *zap.Logger
|
||||
listsCache *cache.ObjectsListCache
|
||||
objCache *cache.ObjectsCache
|
||||
|
@ -46,6 +56,7 @@ func DefaultCachesConfigs(logger *zap.Logger) *CachesConfig {
|
|||
|
||||
func NewCache(cfg *CachesConfig) *Cache {
|
||||
return &Cache{
|
||||
testCache: map[string]TestCacheValue{},
|
||||
logger: cfg.Logger,
|
||||
listsCache: cache.NewObjectsListCache(cfg.ObjectsList),
|
||||
objCache: cache.New(cfg.Objects),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue