metainfo

package
v0.20.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2019 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidType error for inalid response type casting
	ErrInvalidType = errs.New("invalid response type")
)
View Source
var (

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

Functions

This section is empty.

Types

type BatchItem added in v0.17.0

type BatchItem interface {
	BatchItem() *pb.BatchRequestItem
}

BatchItem represents single request in batch

type BatchResponse added in v0.17.0

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

BatchResponse single response from batch call

func (*BatchResponse) BeginDeleteObject added in v0.17.0

func (resp *BatchResponse) BeginDeleteObject() (BeginDeleteObjectResponse, error)

BeginDeleteObject returns response for BeginDeleteObject request

func (*BatchResponse) BeginDeleteSegment added in v0.17.0

func (resp *BatchResponse) BeginDeleteSegment() (BeginDeleteSegmentResponse, error)

BeginDeleteSegment returns response for BeginDeleteSegment request

func (*BatchResponse) BeginObject added in v0.17.0

func (resp *BatchResponse) BeginObject() (BeginObjectResponse, error)

BeginObject returns response for BeginObject request

func (*BatchResponse) BeginSegment added in v0.17.0

func (resp *BatchResponse) BeginSegment() (BeginSegmentResponse, error)

BeginSegment returns response for BeginSegment request

func (*BatchResponse) CreateBucket added in v0.17.0

func (resp *BatchResponse) CreateBucket() (CreateBucketResponse, error)

CreateBucket returns BatchResponse for CreateBucket request

func (*BatchResponse) DownloadSegment added in v0.17.0

func (resp *BatchResponse) DownloadSegment() (DownloadSegmentResponse, error)

DownloadSegment returns response for DownloadSegment request

func (*BatchResponse) GetBucket added in v0.17.0

func (resp *BatchResponse) GetBucket() (GetBucketResponse, error)

GetBucket returns response for GetBucket request

func (*BatchResponse) GetObject added in v0.17.0

func (resp *BatchResponse) GetObject() (GetObjectResponse, error)

GetObject returns response for GetObject request

func (*BatchResponse) ListBuckets added in v0.17.0

func (resp *BatchResponse) ListBuckets() (ListBucketsResponse, error)

ListBuckets returns response for ListBuckets request

func (*BatchResponse) ListObjects added in v0.17.0

func (resp *BatchResponse) ListObjects() (ListObjectsResponse, error)

ListObjects returns response for ListObjects request

func (*BatchResponse) ListSegment added in v0.17.0

func (resp *BatchResponse) ListSegment() (ListSegmentsResponse, error)

ListSegment returns response for ListSegment request

type BeginDeleteObjectParams added in v0.16.0

type BeginDeleteObjectParams struct {
	Bucket        []byte
	EncryptedPath []byte
	Version       int32
}

BeginDeleteObjectParams parameters for BeginDeleteObject method

func (*BeginDeleteObjectParams) BatchItem added in v0.17.0

func (params *BeginDeleteObjectParams) BatchItem() *pb.BatchRequestItem

BatchItem returns single item for batch request

type BeginDeleteObjectResponse added in v0.17.0

type BeginDeleteObjectResponse struct {
	StreamID storj.StreamID
}

BeginDeleteObjectResponse response for BeginDeleteObject request

type BeginDeleteSegmentParams added in v0.16.0

type BeginDeleteSegmentParams struct {
	StreamID storj.StreamID
	Position storj.SegmentPosition
}

BeginDeleteSegmentParams parameters for BeginDeleteSegment method

func (*BeginDeleteSegmentParams) BatchItem added in v0.17.0

func (params *BeginDeleteSegmentParams) BatchItem() *pb.BatchRequestItem

BatchItem returns single item for batch request

type BeginDeleteSegmentResponse added in v0.17.0

type BeginDeleteSegmentResponse struct {
	SegmentID       storj.SegmentID
	Limits          []*pb.AddressedOrderLimit
	PiecePrivateKey storj.PiecePrivateKey
}

BeginDeleteSegmentResponse response for BeginDeleteSegment request

type BeginObjectParams added in v0.16.0

type BeginObjectParams struct {
	Bucket               []byte
	EncryptedPath        []byte
	Version              int32
	Redundancy           storj.RedundancyScheme
	EncryptionParameters storj.EncryptionParameters
	ExpiresAt            time.Time
}

BeginObjectParams parmaters for BeginObject method

func (*BeginObjectParams) BatchItem added in v0.17.0

func (params *BeginObjectParams) BatchItem() *pb.BatchRequestItem

BatchItem returns single item for batch request

type BeginObjectResponse added in v0.17.0

type BeginObjectResponse struct {
	StreamID storj.StreamID
}

BeginObjectResponse response for BeginObject request

type BeginSegmentParams added in v0.16.0

type BeginSegmentParams struct {
	StreamID     storj.StreamID
	Position     storj.SegmentPosition
	MaxOderLimit int64
}

BeginSegmentParams parameters for BeginSegment method

func (*BeginSegmentParams) BatchItem added in v0.17.0

func (params *BeginSegmentParams) BatchItem() *pb.BatchRequestItem

BatchItem returns single item for batch request

type BeginSegmentResponse added in v0.17.0

type BeginSegmentResponse struct {
	SegmentID       storj.SegmentID
	Limits          []*pb.AddressedOrderLimit
	PiecePrivateKey storj.PiecePrivateKey
}

BeginSegmentResponse response for BeginSegment request

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) Batch added in v0.17.0

func (client *Client) Batch(ctx context.Context, requests ...BatchItem) (resp []BatchResponse, err error)

Batch sends multiple requests in one batch

func (*Client) BeginDeleteObject added in v0.16.0

func (client *Client) BeginDeleteObject(ctx context.Context, params BeginDeleteObjectParams) (_ storj.StreamID, err error)

BeginDeleteObject begins object deletion process

func (*Client) BeginDeleteSegment added in v0.16.0

func (client *Client) BeginDeleteSegment(ctx context.Context, params BeginDeleteSegmentParams) (_ storj.SegmentID, limits []*pb.AddressedOrderLimit, _ storj.PiecePrivateKey, err error)

BeginDeleteSegment begins segment upload process

func (*Client) BeginObject added in v0.16.0

func (client *Client) BeginObject(ctx context.Context, params BeginObjectParams) (_ storj.StreamID, err error)

BeginObject begins object creation

func (*Client) BeginSegment added in v0.16.0

func (client *Client) BeginSegment(ctx context.Context, params BeginSegmentParams) (_ storj.SegmentID, limits []*pb.AddressedOrderLimit, piecePrivateKey storj.PiecePrivateKey, err error)

BeginSegment begins segment upload

func (*Client) Close added in v0.14.4

func (client *Client) Close() error

Close closes the dialed connection.

func (*Client) CommitObject added in v0.16.0

func (client *Client) CommitObject(ctx context.Context, params CommitObjectParams) (err error)

CommitObject commits created object

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) CommitSegmentNew added in v0.17.0

func (client *Client) CommitSegmentNew(ctx context.Context, params CommitSegmentParams) (err error)

CommitSegmentNew commits segment after upload

func (*Client) CreateBucket added in v0.15.0

func (client *Client) CreateBucket(ctx context.Context, params CreateBucketParams) (respBucket 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, params DeleteBucketParams) (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) DownloadSegment added in v0.16.0

func (client *Client) DownloadSegment(ctx context.Context, params DownloadSegmentParams) (_ storj.SegmentDownloadInfo, _ []*pb.AddressedOrderLimit, err error)

DownloadSegment gets info for downloading remote segment or data from inline segment

func (*Client) FinishDeleteObject added in v0.16.0

func (client *Client) FinishDeleteObject(ctx context.Context, params FinishDeleteObjectParams) (err error)

FinishDeleteObject finishes object deletion process

func (*Client) FinishDeleteSegment added in v0.16.0

func (client *Client) FinishDeleteSegment(ctx context.Context, params FinishDeleteSegmentParams) (err error)

FinishDeleteSegment finishes segment upload process

func (*Client) GetBucket added in v0.15.0

func (client *Client) GetBucket(ctx context.Context, params GetBucketParams) (respBucket storj.Bucket, err error)

GetBucket returns a bucket

func (*Client) GetObject added in v0.16.0

func (client *Client) GetObject(ctx context.Context, params GetObjectParams) (_ storj.ObjectInfo, err error)

GetObject gets single object

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, params ListBucketsParams) (_ storj.BucketList, err error)

ListBuckets lists buckets

func (*Client) ListObjects added in v0.16.0

func (client *Client) ListObjects(ctx context.Context, params ListObjectsParams) (_ []storj.ObjectListItem, more bool, err error)

ListObjects lists objects according to specific parameters

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) ListSegmentsNew added in v0.17.0

func (client *Client) ListSegmentsNew(ctx context.Context, params ListSegmentsParams) (_ []storj.SegmentListItem, more bool, err error)

ListSegmentsNew lists object segments

func (*Client) MakeInlineSegment added in v0.16.0

func (client *Client) MakeInlineSegment(ctx context.Context, params MakeInlineSegmentParams) (err error)

MakeInlineSegment commits segment after upload

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.

func (*Client) SetBucketAttribution added in v0.17.0

func (client *Client) SetBucketAttribution(ctx context.Context, params SetBucketAttributionParams) (err error)

SetBucketAttribution tries to set the attribution information on the bucket.

type CommitObjectParams added in v0.17.0

type CommitObjectParams struct {
	StreamID storj.StreamID

	EncryptedMetadataNonce storj.Nonce
	EncryptedMetadata      []byte
}

CommitObjectParams parmaters for CommitObject method

func (*CommitObjectParams) BatchItem added in v0.17.0

func (params *CommitObjectParams) BatchItem() *pb.BatchRequestItem

BatchItem returns single item for batch request

type CommitSegmentParams added in v0.16.0

type CommitSegmentParams struct {
	SegmentID         storj.SegmentID
	Encryption        storj.SegmentEncryption
	SizeEncryptedData int64

	UploadResult []*pb.SegmentPieceUploadResult
}

CommitSegmentParams parameters for CommitSegment method

func (*CommitSegmentParams) BatchItem added in v0.17.0

func (params *CommitSegmentParams) BatchItem() *pb.BatchRequestItem

BatchItem returns single item for batch request

type CreateBucketParams added in v0.17.0

type CreateBucketParams struct {
	Name                        []byte
	PathCipher                  storj.CipherSuite
	PartnerID                   []byte
	DefaultSegmentsSize         int64
	DefaultRedundancyScheme     storj.RedundancyScheme
	DefaultEncryptionParameters storj.EncryptionParameters
}

CreateBucketParams parameters for CreateBucket method

func (*CreateBucketParams) BatchItem added in v0.17.0

func (params *CreateBucketParams) BatchItem() *pb.BatchRequestItem

BatchItem returns single item for batch request

type CreateBucketResponse added in v0.17.0

type CreateBucketResponse struct {
	Bucket storj.Bucket
}

CreateBucketResponse response for CreateBucket request

type DeleteBucketParams added in v0.17.0

type DeleteBucketParams struct {
	Name []byte
}

DeleteBucketParams parmaters for DeleteBucket method

func (*DeleteBucketParams) BatchItem added in v0.17.0

func (params *DeleteBucketParams) BatchItem() *pb.BatchRequestItem

BatchItem returns single item for batch request

type DownloadSegmentParams added in v0.16.0

type DownloadSegmentParams struct {
	StreamID storj.StreamID
	Position storj.SegmentPosition
}

DownloadSegmentParams parameters for DownloadSegment method

func (*DownloadSegmentParams) BatchItem added in v0.17.0

func (params *DownloadSegmentParams) BatchItem() *pb.BatchRequestItem

BatchItem returns single item for batch request

type DownloadSegmentResponse added in v0.17.0

type DownloadSegmentResponse struct {
	Info storj.SegmentDownloadInfo

	Limits []*pb.AddressedOrderLimit
}

DownloadSegmentResponse response for DownloadSegment request

type FinishDeleteObjectParams added in v0.17.0

type FinishDeleteObjectParams struct {
	StreamID storj.StreamID
}

FinishDeleteObjectParams parameters for FinishDeleteObject method

func (*FinishDeleteObjectParams) BatchItem added in v0.17.0

func (params *FinishDeleteObjectParams) BatchItem() *pb.BatchRequestItem

BatchItem returns single item for batch request

type FinishDeleteSegmentParams added in v0.16.0

type FinishDeleteSegmentParams struct {
	SegmentID storj.SegmentID

	DeleteResults []*pb.SegmentPieceDeleteResult
}

FinishDeleteSegmentParams parameters for FinishDeleteSegment method

func (*FinishDeleteSegmentParams) BatchItem added in v0.17.0

func (params *FinishDeleteSegmentParams) BatchItem() *pb.BatchRequestItem

BatchItem returns single item for batch request

type GetBucketParams added in v0.17.0

type GetBucketParams struct {
	Name []byte
}

GetBucketParams parmaters for GetBucketParams method

func (*GetBucketParams) BatchItem added in v0.17.0

func (params *GetBucketParams) BatchItem() *pb.BatchRequestItem

BatchItem returns single item for batch request

type GetBucketResponse added in v0.17.0

type GetBucketResponse struct {
	Bucket storj.Bucket
}

GetBucketResponse response for GetBucket request

type GetObjectParams added in v0.16.0

type GetObjectParams struct {
	Bucket        []byte
	EncryptedPath []byte
	Version       int32
}

GetObjectParams parameters for GetObject method

func (*GetObjectParams) BatchItem added in v0.17.0

func (params *GetObjectParams) BatchItem() *pb.BatchRequestItem

BatchItem returns single item for batch request

type GetObjectResponse added in v0.17.0

type GetObjectResponse struct {
	Info storj.ObjectInfo
}

GetObjectResponse response for GetObject request

type ListBucketsParams added in v0.17.0

type ListBucketsParams struct {
	ListOpts storj.BucketListOptions
}

ListBucketsParams parmaters for ListBucketsParams method

func (*ListBucketsParams) BatchItem added in v0.17.0

func (params *ListBucketsParams) BatchItem() *pb.BatchRequestItem

BatchItem returns single item for batch request

type ListBucketsResponse added in v0.17.0

type ListBucketsResponse struct {
	BucketList storj.BucketList
}

ListBucketsResponse response for ListBucket request

type ListItem

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

ListItem is a single item in a listing

type ListObjectsParams added in v0.16.0

type ListObjectsParams struct {
	Bucket          []byte
	EncryptedPrefix []byte
	EncryptedCursor []byte
	Limit           int32
	IncludeMetadata bool
	Recursive       bool
}

ListObjectsParams parameters for ListObjects method

func (*ListObjectsParams) BatchItem added in v0.17.0

func (params *ListObjectsParams) BatchItem() *pb.BatchRequestItem

BatchItem returns single item for batch request

type ListObjectsResponse added in v0.17.0

type ListObjectsResponse struct {
	Items []storj.ObjectListItem
	More  bool
}

ListObjectsResponse response for ListObjects request

type ListSegmentsParams added in v0.16.0

type ListSegmentsParams struct {
	StreamID       storj.StreamID
	CursorPosition storj.SegmentPosition
	Limit          int32
}

ListSegmentsParams parameters for ListSegment method

func (*ListSegmentsParams) BatchItem added in v0.17.0

func (params *ListSegmentsParams) BatchItem() *pb.BatchRequestItem

BatchItem returns single item for batch request

type ListSegmentsResponse added in v0.17.0

type ListSegmentsResponse struct {
	Items []storj.SegmentListItem
	More  bool
}

ListSegmentsResponse response for ListSegments request

type MakeInlineSegmentParams added in v0.16.0

type MakeInlineSegmentParams struct {
	StreamID            storj.StreamID
	Position            storj.SegmentPosition
	Encryption          storj.SegmentEncryption
	EncryptedInlineData []byte
}

MakeInlineSegmentParams parameters for MakeInlineSegment method

func (*MakeInlineSegmentParams) BatchItem added in v0.17.0

func (params *MakeInlineSegmentParams) BatchItem() *pb.BatchRequestItem

BatchItem returns single item for batch request

type SetBucketAttributionParams added in v0.17.0

type SetBucketAttributionParams struct {
	Bucket    string
	PartnerID uuid.UUID
}

SetBucketAttributionParams parameters for SetBucketAttribution method

func (*SetBucketAttributionParams) BatchItem added in v0.17.0

func (params *SetBucketAttributionParams) BatchItem() *pb.BatchRequestItem

BatchItem returns single item for batch request

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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