metainfo

package
v0.15.3 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Error is the errs class of standard metainfo errors
	Error = errs.Class("metainfo error")
)

Functions

This section is empty.

Types

type Client

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

Client creates a grpcClient

func Dial added in v0.14.4

func Dial(ctx context.Context, tc transport.Client, address string, apiKey string) (*Client, error)

Dial dials to metainfo endpoint with the specified api key.

func New

func New(client pb.MetainfoClient) *Client

New used as a public function

func (*Client) Close added in v0.14.4

func (client *Client) Close() error

Close closes the dialed connection.

func (*Client) CommitSegment

func (client *Client) CommitSegment(ctx context.Context, bucket string, path storj.Path, segmentIndex int64, pointer *pb.Pointer, originalLimits []*pb.OrderLimit) (savedPointer *pb.Pointer, err error)

CommitSegment requests to store the pointer for the segment

func (*Client) CreateBucket added in v0.15.0

func (client *Client) CreateBucket(ctx context.Context, bucket storj.Bucket) (_ storj.Bucket, err error)

CreateBucket creates a new bucket

func (*Client) CreateSegment

func (client *Client) CreateSegment(ctx context.Context, bucket string, path storj.Path, segmentIndex int64, redundancy *pb.RedundancyScheme, maxEncryptedSegmentSize int64, expiration time.Time) (limits []*pb.AddressedOrderLimit, rootPieceID storj.PieceID, piecePrivateKey storj.PiecePrivateKey, err error)

CreateSegment requests the order limits for creating a new segment

func (*Client) DeleteBucket added in v0.15.0

func (client *Client) DeleteBucket(ctx context.Context, bucketName string) (err error)

DeleteBucket deletes a bucket

func (*Client) DeleteSegment

func (client *Client) DeleteSegment(ctx context.Context, bucket string, path storj.Path, segmentIndex int64) (limits []*pb.AddressedOrderLimit, piecePrivateKey storj.PiecePrivateKey, err error)

DeleteSegment requests the order limits for deleting a segment

func (*Client) GetBucket added in v0.15.0

func (client *Client) GetBucket(ctx context.Context, bucketName string) (_ storj.Bucket, err error)

GetBucket returns a bucket

func (*Client) GetProjectInfo added in v0.14.4

func (client *Client) GetProjectInfo(ctx context.Context) (resp *pb.ProjectInfoResponse, err error)

GetProjectInfo gets the ProjectInfo for the api key associated with the metainfo client.

func (*Client) ListBuckets added in v0.15.0

func (client *Client) ListBuckets(ctx context.Context, listOpts storj.BucketListOptions) (_ storj.BucketList, err error)

ListBuckets lists buckets

func (*Client) ListSegments

func (client *Client) ListSegments(ctx context.Context, bucket string, prefix, startAfter, endBefore storj.Path, recursive bool, limit int32, metaFlags uint32) (items []ListItem, more bool, err error)

ListSegments lists the available segments

func (*Client) ReadSegment

func (client *Client) ReadSegment(ctx context.Context, bucket string, path storj.Path, segmentIndex int64) (pointer *pb.Pointer, limits []*pb.AddressedOrderLimit, piecePrivateKey storj.PiecePrivateKey, err error)

ReadSegment requests the order limits for reading a segment

func (*Client) SegmentInfo

func (client *Client) SegmentInfo(ctx context.Context, bucket string, path storj.Path, segmentIndex int64) (pointer *pb.Pointer, err error)

SegmentInfo requests the pointer of a segment

func (*Client) SetAttribution added in v0.14.0

func (client *Client) SetAttribution(ctx context.Context, bucket string, partnerID uuid.UUID) (err error)

SetAttribution tries to set the attribution information on the bucket.

type ListItem

type ListItem struct {
	Path     storj.Path
	Pointer  *pb.Pointer
	IsPrefix bool
}

ListItem is a single item in a listing

Jump to

Keyboard shortcuts

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