upload

package
v2.0.5-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrometheusSubsystemName = "dragonfly_dfdaemon_upload"
	OtelServiceName         = "dragonfly-dfdaemon-upload"
)

Variables

View Source
var GinLogFileName = "gin-upload.log"

Functions

func WithLimiter

func WithLimiter(limiter *rate.Limiter) func(*uploadManager)

WithLimiter sets upload rate limiter, the burst size must be bigger than piece size.

Types

type DownalodQuery added in v2.0.4

type DownalodQuery struct {
	PeerID string `form:"peerId" binding:"required"`
}

type DownloadParams added in v2.0.4

type DownloadParams struct {
	TaskPrefix string `uri:"task_prefix" binding:"required"`
	TaskID     string `uri:"task_id" binding:"required"`
}

type Manager

type Manager interface {
	// Started upload manager server.
	Serve(lis net.Listener) error

	// Stop upload manager server.
	Stop() error
}

Manager is the interface used for upload task.

func NewUploadManager

func NewUploadManager(cfg *config.DaemonOption, storageManager storage.Manager, logDir string, opts ...Option) (Manager, error)

New returns a new Manager instence.

type Option added in v2.0.4

type Option func(um *uploadManager)

Option is a functional option for configuring the upload manager.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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