downloader

package
v0.1.3-test-1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Downloader

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

Downloader implements the gRPC of DownloaderService, responsible for downloading object payload data

func NewDownloaderService

func NewDownloaderService(cfg *DownloaderConfig) (*Downloader, error)

NewDownloaderService returns an instance of Downloader that implementation of the lifecycle.Service and DownloaderService interface

func (*Downloader) GetBucketReadQuota

func (downloader *Downloader) GetBucketReadQuota(ctx context.Context, req *types.GetBucketReadQuotaRequest) (*types.GetBucketReadQuotaResponse, error)

GetBucketReadQuota get the quota info of the specified month.

func (*Downloader) GetEndpointBySpAddress added in v0.1.1

func (downloader *Downloader) GetEndpointBySpAddress(ctx context.Context, req *types.GetEndpointBySpAddressRequest) (resp *types.GetEndpointBySpAddressResponse, err error)

GetEndpointBySpAddress get endpoint by sp address

func (*Downloader) GetObject

func (downloader *Downloader) GetObject(req *types.GetObjectRequest,
	stream types.DownloaderService_GetObjectServer) (err error)

GetObject downloads the payload of the object.

func (*Downloader) ListBucketReadRecord

func (downloader *Downloader) ListBucketReadRecord(ctx context.Context, req *types.ListBucketReadRecordRequest) (*types.ListBucketReadRecordResponse, error)

ListBucketReadRecord get read record list of the specified time range.

func (*Downloader) Name

func (downloader *Downloader) Name() string

Name return the downloader service name, for the lifecycle management

func (*Downloader) SplitToSegmentPieceInfos added in v0.1.1

func (downloader *Downloader) SplitToSegmentPieceInfos(objectID, objectSize, start, end uint64) (pieceInfos []*segmentPieceInfo, err error)

SplitToSegmentPieceInfos compute the piece store info for get object, object data range [start, end].

func (*Downloader) Start

func (downloader *Downloader) Start(ctx context.Context) error

Start the downloader gRPC service

func (*Downloader) Stop

func (downloader *Downloader) Stop(ctx context.Context) error

Stop the downloader gRPC service and recycle the resources

type DownloaderConfig

type DownloaderConfig struct {
	GRPCAddress      string
	SpDBConfig       *config.SQLDBConfig
	PieceStoreConfig *storage.PieceStoreConfig
}

DownloaderConfig defines downloader service config

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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