metabase

package
v1.17.7-rc Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 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 (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 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 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.

Jump to

Keyboard shortcuts

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