Documentation ¶
Index ¶
Constants ¶
const ( LastSegmentName = "l" LastSegmentIndex = -1 FirstSegmentIndex = 0 )
Common constants for segment keys.
Variables ¶
var Error = errs.Class("metabase")
Error is the default error for metabase.
Functions ¶
This section is empty.
Types ¶
type BucketLocation ¶
BucketLocation defines a bucket that belongs to a project.
func ParseBucketPrefix ¶
func ParseBucketPrefix(prefix BucketPrefix) (BucketLocation, error)
ParseBucketPrefix parses BucketPrefix.
func ParseCompactBucketPrefix ¶ added in v1.19.9
func ParseCompactBucketPrefix(compactPrefix []byte) (BucketLocation, error)
ParseCompactBucketPrefix parses BucketPrefix.
func (BucketLocation) CompactPrefix ¶ added in v1.19.9
func (loc BucketLocation) CompactPrefix() []byte
CompactPrefix converts bucket location into bucket prefix with compact project ID.
func (BucketLocation) Prefix ¶
func (loc BucketLocation) Prefix() BucketPrefix
Prefix converts bucket location into bucket prefix.
type ObjectEntry ¶ added in v1.22.1
type ObjectEntry struct {
ObjectKey ObjectKey
}
ObjectEntry contains information about an object in a bucket.
type ObjectKey ¶
type ObjectKey string
ObjectKey is an encrypted object key encoded using Path Component Encoding. It is not ascii safe.
type ObjectLocation ¶
ObjectLocation is decoded object key information.
func (ObjectLocation) Bucket ¶
func (obj ObjectLocation) Bucket() BucketLocation
Bucket returns bucket location this object belongs to.
func (ObjectLocation) FirstSegment ¶
func (obj ObjectLocation) FirstSegment() SegmentLocation
FirstSegment returns the first segment location.
func (ObjectLocation) LastSegment ¶
func (obj ObjectLocation) LastSegment() SegmentLocation
LastSegment returns the last segment location.
func (ObjectLocation) Segment ¶
func (obj ObjectLocation) Segment(index int64) (SegmentLocation, error)
Segment returns segment location for a given index.
type Segment ¶ added in v1.22.1
type Segment struct {
Position SegmentPosition
}
Segment segment metadata.
type SegmentKey ¶
type SegmentKey []byte
SegmentKey is an encoded metainfo key. This is used as the key in pointerdb key-value store.
type SegmentLocation ¶
type SegmentLocation struct { ProjectID uuid.UUID BucketName string Index int64 ObjectKey ObjectKey }
SegmentLocation is decoded segment key information.
func ParseSegmentKey ¶
func ParseSegmentKey(encoded SegmentKey) (SegmentLocation, error)
ParseSegmentKey parses an segment key into segment location.
func (SegmentLocation) Bucket ¶
func (seg SegmentLocation) Bucket() BucketLocation
Bucket returns bucket location this segment belongs to.
func (SegmentLocation) Encode ¶
func (seg SegmentLocation) Encode() SegmentKey
Encode converts segment location into a segment key.
func (SegmentLocation) IsFirst ¶
func (seg SegmentLocation) IsFirst() bool
IsFirst returns whether this corresponds to first segment.
func (SegmentLocation) IsLast ¶
func (seg SegmentLocation) IsLast() bool
IsLast returns whether this corresponds to last segment.
func (SegmentLocation) Object ¶
func (seg SegmentLocation) Object() ObjectLocation
Object returns the object location associated with this segment location.
type SegmentPosition ¶ added in v1.22.1
SegmentPosition is segment part and index combined.