metabase

package
v1.22.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2021 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LastSegmentName   = "l"
	LastSegmentIndex  = -1
	FirstSegmentIndex = 0
)

Common constants for segment keys.

Variables

View Source
var Error = errs.Class("metabase")

Error is the default error for metabase.

Functions

This section is empty.

Types

type BucketLocation

type BucketLocation struct {
	ProjectID  uuid.UUID
	BucketName string
}

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 BucketPrefix

type BucketPrefix string

BucketPrefix consists of <project id>/<bucket name>.

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

type ObjectLocation struct {
	ProjectID  uuid.UUID
	BucketName string
	ObjectKey  ObjectKey
}

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 Piece added in v1.16.1

type Piece struct {
	Number      uint16
	StorageNode storj.NodeID
}

Piece defines information for a segment piece.

type Pieces added in v1.16.1

type Pieces []Piece

Pieces defines information for pieces.

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

type SegmentPosition struct {
	Part  uint32
	Index uint32
}

SegmentPosition is segment part and index combined.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL