Skip to content

Commit

Permalink
[Go API change] new field BaseNameOnly in ArchiveMultiObj API
Browse files Browse the repository at this point in the history
This boolean field specifys that only extract base name as names of archived
objects. Necessary for dsort to correctly recognize the record keys.

Signed-off-by: Tony Chen <[email protected]>
  • Loading branch information
Nahemah1022 committed Jul 25, 2024
1 parent 33fa512 commit 70165c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api/apc/multiobj.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ type (
ArchName string `json:"archname"` // one of the archive.FileExtensions
Mime string `json:"mime"` // user-specified mime type (NOTE: takes precedence if defined)
ListRange
InclSrcBname bool `json:"isbn"` // include source bucket name into the names of archived objects
AppendIfExists bool `json:"aate"` // adding a list or a range of objects to an existing archive
ContinueOnError bool `json:"coer"` // on err, keep running arc xaction in a any given multi-object transaction
BaseNameOnly bool `json:"bnonly"` // only extract the base name of objects as names of archived objects
InclSrcBname bool `json:"isbn"` // include source bucket name into the names of archived objects
AppendIfExists bool `json:"aate"` // adding a list or a range of objects to an existing archive
ContinueOnError bool `json:"coer"` // on err, keep running arc xaction in a any given multi-object transaction
}

// Multi-object copy & transform (see also: TCBMsg)
TCObjsMsg struct {
ListRange
Expand Down
3 changes: 3 additions & 0 deletions xact/xs/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,9 @@ func (wi *archwi) quiesce() core.QuiRes {
}

func (wi *archwi) nameInArch(objName string) string {
if wi.msg.BaseNameOnly {
objName = filepath.Base(objName)
}
if !wi.msg.InclSrcBname {
return objName
}
Expand Down

0 comments on commit 70165c8

Please sign in to comment.