metainfo

package
v0.11.7 Latest Latest
Warning

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

Go to latest
Published: May 21, 2019 License: AGPL-3.0 Imports: 28 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// BoltPointerBucket is the string representing the bucket used for `PointerEntries` in BoltDB
	BoltPointerBucket = "pointers"
)

Variables

View Source
var (

	// Error general metainfo error
	Error = errs.Class("metainfo error")
)

Functions

func CreatePath

func CreatePath(projectID uuid.UUID, segmentIndex int64, bucket, path []byte) (storj.Path, error)

CreatePath will create a Segment path

func NewStore added in v0.11.0

func NewStore(dbURLString string) (db storage.KeyValueStore, err error)

NewStore returns database for storing pointer data

Types

type APIKeys

type APIKeys interface {
	GetByKey(ctx context.Context, key console.APIKey) (*console.APIKeyInfo, error)
}

APIKeys is api keys store methods used by endpoint

type Config added in v0.11.0

type Config struct {
	DatabaseURL          string      `help:"the database connection string to use" releaseDefault:"postgres://" devDefault:"bolt://$CONFDIR/pointerdb.db"`
	MinRemoteSegmentSize memory.Size `default:"1240" help:"minimum remote segment size"`
	MaxInlineSegmentSize memory.Size `default:"8000" help:"maximum inline segment size"`
	Overlay              bool        `default:"true" help:"toggle flag if overlay is enabled"`
	BwExpiration         int         `default:"45"   help:"lifespan of bandwidth agreements in days"`
}

Config is a configuration struct that is everything you need to start a metainfo

type Endpoint

type Endpoint struct {
	// contains filtered or unexported fields
}

Endpoint metainfo endpoint

func NewEndpoint

func NewEndpoint(log *zap.Logger, metainfo *Service, orders *orders.Service, cache *overlay.Cache, apiKeys APIKeys, acctDB accounting.DB, maxAlphaUsage memory.Size) *Endpoint

NewEndpoint creates new metainfo endpoint instance

func (*Endpoint) Close

func (endpoint *Endpoint) Close() error

Close closes resources

func (*Endpoint) CommitSegment

func (endpoint *Endpoint) CommitSegment(ctx context.Context, req *pb.SegmentCommitRequest) (resp *pb.SegmentCommitResponse, err error)

CommitSegment commits segment metadata

func (*Endpoint) CreateSegment

func (endpoint *Endpoint) CreateSegment(ctx context.Context, req *pb.SegmentWriteRequest) (resp *pb.SegmentWriteResponse, err error)

CreateSegment will generate requested number of OrderLimit with coresponding node addresses for them

func (*Endpoint) DeleteSegment

func (endpoint *Endpoint) DeleteSegment(ctx context.Context, req *pb.SegmentDeleteRequest) (resp *pb.SegmentDeleteResponse, err error)

DeleteSegment deletes segment metadata from satellite and returns OrderLimit array to remove them from storage node

func (*Endpoint) DownloadSegment

func (endpoint *Endpoint) DownloadSegment(ctx context.Context, req *pb.SegmentDownloadRequest) (resp *pb.SegmentDownloadResponse, err error)

DownloadSegment gets Pointer incase of INLINE data or list of OrderLimit necessary to download remote data

func (*Endpoint) ListSegments

func (endpoint *Endpoint) ListSegments(ctx context.Context, req *pb.ListSegmentsRequest) (resp *pb.ListSegmentsResponse, err error)

ListSegments returns all Path keys in the Pointers bucket

func (*Endpoint) SegmentInfo

func (endpoint *Endpoint) SegmentInfo(ctx context.Context, req *pb.SegmentInfoRequest) (resp *pb.SegmentInfoResponse, err error)

SegmentInfo returns segment metadata info

type Service added in v0.11.0

type Service struct {
	DB storage.KeyValueStore
	// contains filtered or unexported fields
}

Service structure

func NewService added in v0.11.0

func NewService(logger *zap.Logger, db storage.KeyValueStore) *Service

NewService creates new metainfo service

func (*Service) Delete added in v0.11.0

func (s *Service) Delete(path string) (err error)

Delete deletes from item from db

func (*Service) Get added in v0.11.0

func (s *Service) Get(path string) (pointer *pb.Pointer, err error)

Get gets pointer from db

func (*Service) Iterate added in v0.11.0

func (s *Service) Iterate(prefix string, first string, recurse bool, reverse bool, f func(it storage.Iterator) error) (err error)

Iterate iterates over items in db

func (*Service) List added in v0.11.0

func (s *Service) List(prefix string, startAfter string, endBefore string, recursive bool, limit int32,
	metaFlags uint32) (items []*pb.ListResponse_Item, more bool, err error)

List returns all Path keys in the pointers bucket

func (*Service) Put added in v0.11.0

func (s *Service) Put(path string, pointer *pb.Pointer) (err error)

Put puts pointer to db under specific path

Jump to

Keyboard shortcuts

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