Skip to content

Commit

Permalink
satellite/metabase: add ObjectStatus.String
Browse files Browse the repository at this point in the history
Change-Id: Icfa759c08b497133b8a84e0b0b1907f2e77e6e5f
  • Loading branch information
egonelbre committed Jan 9, 2024
1 parent ca42e2b commit 7852a6b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions satellite/metabase/common.go
Expand Up @@ -6,6 +6,7 @@ package metabase
import (
"database/sql/driver"
"encoding/binary"
"fmt"
"math"
"sort"
"strconv"
Expand Down Expand Up @@ -467,6 +468,28 @@ func (status ObjectStatus) IsDeleteMarker() bool {
return status == DeleteMarkerUnversioned || status == DeleteMarkerVersioned
}

// String returns textual representation of status.
func (status ObjectStatus) String() string {
switch status {
case Pending:
return "Pending"
case ObjectStatus(2):
return "Deleted" // Deprecated
case CommittedUnversioned:
return "CommittedUnversioned"
case CommittedVersioned:
return "CommittedVersioned"
case DeleteMarkerVersioned:
return "DeleteMarkerVersioned"
case DeleteMarkerUnversioned:
return "DeleteMarkerUnversioned"
case Prefix:
return "Prefix"
default:
return fmt.Sprintf("ObjectStatus(%d)", int(status))
}
}

// Pieces defines information for pieces.
type Pieces []Piece

Expand Down

0 comments on commit 7852a6b

Please sign in to comment.