metainfo

package
v0.14.6 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2019 License: AGPL-3.0 Imports: 15 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.OrderLimit2) (savedPointer *pb.Pointer, err error)

CommitSegment requests to store the pointer for the segment

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, err error)

CreateSegment requests the order limits for creating a new segment

func (*Client) DeleteSegment

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

DeleteSegment requests the order limits for deleting a segment

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) 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, 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