github.com/NVIDIA/aistore@v1.3.23-0.20240517131212-7df6609be51d/ais/s3/inventory.go (about) 1 // Package s3 provides Amazon S3 compatibility layer 2 /* 3 * Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. 4 */ 5 package s3 6 7 import ( 8 "github.com/NVIDIA/aistore/cmn" 9 "github.com/NVIDIA/aistore/cmn/cos" 10 ) 11 12 // NOTE currently implemented main assumption/requirement: 13 // one bucket, one inventory (for this same bucket), and one statically defined .csv 14 15 const ( 16 InvName = ".inventory" 17 InvSrcExt = ".csv.gz" 18 InvDstExt = ".csv" 19 ) 20 21 func InvPrefObjname(bck *cmn.Bck, name, id string) (prefix, objName string) { 22 if name == "" { 23 name = InvName 24 } 25 prefix = name + cos.PathSeparator + bck.Name 26 if id != "" { 27 prefix += cos.PathSeparator + id 28 } 29 if name == InvName { 30 objName = prefix + InvDstExt 31 } else { 32 objName = InvName + cos.PathSeparator + prefix + InvDstExt 33 } 34 return prefix, objName 35 }