diff options
| author | Konstantin Lebedev <lebedev_k@tochka.com> | 2021-10-14 01:35:33 +0500 |
|---|---|---|
| committer | Konstantin Lebedev <lebedev_k@tochka.com> | 2021-10-14 01:35:33 +0500 |
| commit | 9d6ffa0ea157259b813faeb5b1805df31fdcb69b (patch) | |
| tree | 0ef8de0c98e197442a41e8d2c8728e0e964be98e /weed/filer | |
| parent | be4b3ed509178b6464452cd91fb06718548f9307 (diff) | |
| download | seaweedfs-9d6ffa0ea157259b813faeb5b1805df31fdcb69b.tar.xz seaweedfs-9d6ffa0ea157259b813faeb5b1805df31fdcb69b.zip | |
GetBucketLifecycleConfigurationHandler
Diffstat (limited to 'weed/filer')
| -rw-r--r-- | weed/filer/filer_conf.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/weed/filer/filer_conf.go b/weed/filer/filer_conf.go index 6a23189b8..acd1c6ecf 100644 --- a/weed/filer/filer_conf.go +++ b/weed/filer/filer_conf.go @@ -142,6 +142,18 @@ func (fc *FilerConf) MatchStorageRule(path string) (pathConf *filer_pb.FilerConf return pathConf } +func (fc *FilerConf) GetCollectionTtls(collection string) (ttls map[string]string) { + ttls = make(map[string]string) + fc.rules.Walk(func(key []byte, value interface{}) bool { + t := value.(*filer_pb.FilerConf_PathConf) + if t.Collection == collection { + ttls[t.LocationPrefix] = t.GetTtl() + } + return true + }) + return ttls +} + // merge if values in b is not empty, merge them into a func mergePathConf(a, b *filer_pb.FilerConf_PathConf) { a.Collection = util.Nvl(b.Collection, a.Collection) |
