Documentation ¶
Index ¶
- Constants
- Variables
- func CreatePath(ctx context.Context, projectID uuid.UUID, segmentIndex int64, ...) (_ storj.Path, err error)
- func NewStore(logger *zap.Logger, dbURLString string) (db storage.KeyValueStore, err error)
- type APIKeys
- type BucketsDB
- type Config
- type Containment
- type Endpoint
- func (endpoint *Endpoint) Close() error
- func (endpoint *Endpoint) CommitSegmentOld(ctx context.Context, req *pb.SegmentCommitRequestOld) (resp *pb.SegmentCommitResponseOld, err error)
- func (endpoint *Endpoint) CreateBucket(ctx context.Context, req *pb.BucketCreateRequest) (resp *pb.BucketCreateResponse, err error)
- func (endpoint *Endpoint) CreateSegmentOld(ctx context.Context, req *pb.SegmentWriteRequestOld) (resp *pb.SegmentWriteResponseOld, err error)
- func (endpoint *Endpoint) DeleteBucket(ctx context.Context, req *pb.BucketDeleteRequest) (resp *pb.BucketDeleteResponse, err error)
- func (endpoint *Endpoint) DeleteSegmentOld(ctx context.Context, req *pb.SegmentDeleteRequestOld) (resp *pb.SegmentDeleteResponseOld, err error)
- func (endpoint *Endpoint) DownloadSegmentOld(ctx context.Context, req *pb.SegmentDownloadRequestOld) (resp *pb.SegmentDownloadResponseOld, err error)
- func (endpoint *Endpoint) GetBucket(ctx context.Context, req *pb.BucketGetRequest) (resp *pb.BucketGetResponse, err error)
- func (endpoint *Endpoint) ListBuckets(ctx context.Context, req *pb.BucketListRequest) (resp *pb.BucketListResponse, err error)
- func (endpoint *Endpoint) ListSegmentsOld(ctx context.Context, req *pb.ListSegmentsRequestOld) (resp *pb.ListSegmentsResponseOld, err error)
- func (endpoint *Endpoint) ProjectInfo(ctx context.Context, req *pb.ProjectInfoRequest) (_ *pb.ProjectInfoResponse, err error)
- func (endpoint *Endpoint) SegmentInfoOld(ctx context.Context, req *pb.SegmentInfoRequestOld) (resp *pb.SegmentInfoResponseOld, err error)
- func (endpoint *Endpoint) SetAttributionOld(ctx context.Context, req *pb.SetAttributionRequestOld) (_ *pb.SetAttributionResponseOld, err error)
- func (endpoint *Endpoint) SetBucketAttribution(context.Context, *pb.BucketSetAttributionRequest) (resp *pb.BucketSetAttributionResponse, err error)
- type RSConfig
- type Revocations
- type Service
- func (s *Service) CreateBucket(ctx context.Context, bucket storj.Bucket) (_ storj.Bucket, err error)
- func (s *Service) Delete(ctx context.Context, path string) (err error)
- func (s *Service) DeleteBucket(ctx context.Context, bucketName []byte, projectID uuid.UUID) (err error)
- func (s *Service) Get(ctx context.Context, path string) (pointer *pb.Pointer, err error)
- func (s *Service) GetBucket(ctx context.Context, bucketName []byte, projectID uuid.UUID) (_ storj.Bucket, err error)
- func (s *Service) Iterate(ctx context.Context, prefix string, first string, recurse bool, reverse bool, ...) (err error)
- func (s *Service) List(ctx context.Context, prefix string, startAfter string, endBefore string, ...) (items []*pb.ListResponse_Item, more bool, err error)
- func (s *Service) ListBuckets(ctx context.Context, projectID uuid.UUID, listOpts storj.BucketListOptions, ...) (bucketList storj.BucketList, err error)
- func (s *Service) Put(ctx context.Context, path string, pointer *pb.Pointer) (err error)
- type TTLItem
Constants ¶
const (
// BoltPointerBucket is the string representing the bucket used for `PointerEntries` in BoltDB
BoltPointerBucket = "pointers"
)
Variables ¶
var ( // Error general metainfo error Error = errs.Class("metainfo error") )
Functions ¶
Types ¶
type BucketsDB ¶ added in v0.15.0
type BucketsDB interface { // Create creates a new bucket CreateBucket(ctx context.Context, bucket storj.Bucket) (_ storj.Bucket, err error) // Get returns an existing bucket GetBucket(ctx context.Context, bucketName []byte, projectID uuid.UUID) (bucket storj.Bucket, err error) // Delete deletes a bucket DeleteBucket(ctx context.Context, bucketName []byte, projectID uuid.UUID) (err error) // List returns all buckets for a project ListBuckets(ctx context.Context, projectID uuid.UUID, listOpts storj.BucketListOptions, allowedBuckets macaroon.AllowedBuckets) (bucketList storj.BucketList, err error) }
BucketsDB is the interface for the database to interact with buckets
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"` RS RSConfig `help:"redundancy scheme configuration"` }
Config is a configuration struct that is everything you need to start a metainfo
type Containment ¶ added in v0.12.0
Containment is a copy/paste of containment interface to avoid import cycle error
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, partnerinfo attribution.DB, containment Containment, apiKeys APIKeys, projectUsage *accounting.ProjectUsage, rsConfig RSConfig) *Endpoint
NewEndpoint creates new metainfo endpoint instance
func (*Endpoint) CommitSegmentOld ¶ added in v0.15.0
func (endpoint *Endpoint) CommitSegmentOld(ctx context.Context, req *pb.SegmentCommitRequestOld) (resp *pb.SegmentCommitResponseOld, err error)
CommitSegmentOld commits segment metadata
func (*Endpoint) CreateBucket ¶ added in v0.15.0
func (endpoint *Endpoint) CreateBucket(ctx context.Context, req *pb.BucketCreateRequest) (resp *pb.BucketCreateResponse, err error)
CreateBucket creates a new bucket
func (*Endpoint) CreateSegmentOld ¶ added in v0.15.0
func (endpoint *Endpoint) CreateSegmentOld(ctx context.Context, req *pb.SegmentWriteRequestOld) (resp *pb.SegmentWriteResponseOld, err error)
CreateSegmentOld will generate requested number of OrderLimit with coresponding node addresses for them
func (*Endpoint) DeleteBucket ¶ added in v0.15.0
func (endpoint *Endpoint) DeleteBucket(ctx context.Context, req *pb.BucketDeleteRequest) (resp *pb.BucketDeleteResponse, err error)
DeleteBucket deletes a bucket
func (*Endpoint) DeleteSegmentOld ¶ added in v0.15.0
func (endpoint *Endpoint) DeleteSegmentOld(ctx context.Context, req *pb.SegmentDeleteRequestOld) (resp *pb.SegmentDeleteResponseOld, err error)
DeleteSegmentOld deletes segment metadata from satellite and returns OrderLimit array to remove them from storage node
func (*Endpoint) DownloadSegmentOld ¶ added in v0.15.0
func (endpoint *Endpoint) DownloadSegmentOld(ctx context.Context, req *pb.SegmentDownloadRequestOld) (resp *pb.SegmentDownloadResponseOld, err error)
DownloadSegmentOld gets Pointer incase of INLINE data or list of OrderLimit necessary to download remote data
func (*Endpoint) GetBucket ¶ added in v0.15.0
func (endpoint *Endpoint) GetBucket(ctx context.Context, req *pb.BucketGetRequest) (resp *pb.BucketGetResponse, err error)
GetBucket returns a bucket
func (*Endpoint) ListBuckets ¶ added in v0.15.0
func (endpoint *Endpoint) ListBuckets(ctx context.Context, req *pb.BucketListRequest) (resp *pb.BucketListResponse, err error)
ListBuckets returns buckets in a project where the bucket name matches the request cursor
func (*Endpoint) ListSegmentsOld ¶ added in v0.15.0
func (endpoint *Endpoint) ListSegmentsOld(ctx context.Context, req *pb.ListSegmentsRequestOld) (resp *pb.ListSegmentsResponseOld, err error)
ListSegmentsOld returns all Path keys in the Pointers bucket
func (*Endpoint) ProjectInfo ¶ added in v0.14.0
func (endpoint *Endpoint) ProjectInfo(ctx context.Context, req *pb.ProjectInfoRequest) (_ *pb.ProjectInfoResponse, err error)
ProjectInfo returns allowed ProjectInfo for the provided API key
func (*Endpoint) SegmentInfoOld ¶ added in v0.15.0
func (endpoint *Endpoint) SegmentInfoOld(ctx context.Context, req *pb.SegmentInfoRequestOld) (resp *pb.SegmentInfoResponseOld, err error)
SegmentInfoOld returns segment metadata info
func (*Endpoint) SetAttributionOld ¶ added in v0.15.0
func (endpoint *Endpoint) SetAttributionOld(ctx context.Context, req *pb.SetAttributionRequestOld) (_ *pb.SetAttributionResponseOld, err error)
SetAttributionOld tries to add attribution to the bucket.
func (*Endpoint) SetBucketAttribution ¶ added in v0.15.0
func (endpoint *Endpoint) SetBucketAttribution(context.Context, *pb.BucketSetAttributionRequest) (resp *pb.BucketSetAttributionResponse, err error)
SetBucketAttribution sets the bucket attribution.
type RSConfig ¶ added in v0.14.0
type RSConfig struct { MaxSegmentSize memory.Size `help:"maximum segment size" default:"64MiB"` MaxBufferMem memory.Size `help:"maximum buffer memory to be allocated for read buffers" default:"4MiB"` MinThreshold int `help:"the minimum pieces required to recover a segment. k." releaseDefault:"29" devDefault:"4"` RepairThreshold int `help:"the minimum safe pieces before a repair is triggered. m." releaseDefault:"35" devDefault:"6"` SuccessThreshold int `help:"the desired total pieces for a segment. o." releaseDefault:"80" devDefault:"8"` MaxThreshold int `help:"the largest amount of pieces to encode to. n." releaseDefault:"130" devDefault:"10"` Validate bool `help:"validate redundancy scheme configuration" default:"true"` }
RSConfig is a configuration struct that keeps details about default redundancy strategy information
type Revocations ¶ added in v0.12.0
type Revocations interface {
GetByProjectID(ctx context.Context, projectID uuid.UUID) ([][]byte, error)
}
Revocations is the revocations store methods used by the endpoint
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
NewService creates new metainfo service
func (*Service) CreateBucket ¶ added in v0.15.0
func (s *Service) CreateBucket(ctx context.Context, bucket storj.Bucket) (_ storj.Bucket, err error)
CreateBucket creates a new bucket in the buckets db
func (*Service) DeleteBucket ¶ added in v0.15.0
func (s *Service) DeleteBucket(ctx context.Context, bucketName []byte, projectID uuid.UUID) (err error)
DeleteBucket deletes a bucket from the bucekts db
func (*Service) GetBucket ¶ added in v0.15.0
func (s *Service) GetBucket(ctx context.Context, bucketName []byte, projectID uuid.UUID) (_ storj.Bucket, err error)
GetBucket returns an existing bucket in the buckets db
func (*Service) Iterate ¶ added in v0.11.0
func (s *Service) Iterate(ctx context.Context, prefix string, first string, recurse bool, reverse bool, f func(context.Context, storage.Iterator) error) (err error)
Iterate iterates over items in db
func (*Service) List ¶ added in v0.11.0
func (s *Service) List(ctx context.Context, 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) ListBuckets ¶ added in v0.15.0
func (s *Service) ListBuckets(ctx context.Context, projectID uuid.UUID, listOpts storj.BucketListOptions, allowedBuckets macaroon.AllowedBuckets) (bucketList storj.BucketList, err error)
ListBuckets returns a list of buckets for a project