uploader

package
v0.2.2-hf.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// DefaultUploadObjectParallelPerNode defines the default max parallel of uploading
	// object per uploader.
	DefaultUploadObjectParallelPerNode = 10240
)

Variables

View Source
var (
	ErrDanglingDownloadTask = gfsperrors.Register(module.UploadModularName, http.StatusBadRequest, 110001, "OoooH... request lost, try again later")
	ErrNotCreatedState      = gfsperrors.Register(module.UploadModularName, http.StatusForbidden, 110002, "object not created state")
	ErrRepeatedTask         = gfsperrors.Register(module.UploadModularName, http.StatusNotAcceptable, 110003, "put object request repeated")
	ErrInvalidIntegrity     = gfsperrors.Register(module.UploadModularName, http.StatusNotAcceptable, 110004, "invalid payload data integrity hash")
	ErrClosedStream         = gfsperrors.Register(module.UploadModularName, http.StatusBadRequest, 110005, "upload payload data stream exception")
	ErrPieceStore           = gfsperrors.Register(module.UploadModularName, http.StatusInternalServerError, 115101, "server slipped away, try again later")
	ErrGfSpDB               = gfsperrors.Register(module.UploadModularName, http.StatusInternalServerError, 115001, "server slipped away, try again later")
)

Functions

func DefaultUploaderOptions

func DefaultUploaderOptions(uploader *UploadModular, cfg *gfspconfig.GfSpConfig) error

func NewUploadModular

func NewUploadModular(app *gfspapp.GfSpBaseApp, cfg *gfspconfig.GfSpConfig) (coremodule.Modular, error)

func StreamReadAt

func StreamReadAt(stream io.Reader, b []byte) (int, error)

Types

type UploadModular

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

func (*UploadModular) HandleUploadObjectTask

func (u *UploadModular) HandleUploadObjectTask(ctx context.Context, uploadObjectTask coretask.UploadObjectTask, stream io.Reader) error

func (*UploadModular) Name

func (u *UploadModular) Name() string

func (*UploadModular) PostUploadObject

func (u *UploadModular) PostUploadObject(ctx context.Context, uploadObjectTask coretask.UploadObjectTask)

func (*UploadModular) PreUploadObject

func (u *UploadModular) PreUploadObject(ctx context.Context, uploadObjectTask coretask.UploadObjectTask) error

func (*UploadModular) QueryTasks

func (u *UploadModular) QueryTasks(ctx context.Context, subKey coretask.TKey) (
	[]coretask.Task, error)

func (*UploadModular) ReleaseResource

func (u *UploadModular) ReleaseResource(
	ctx context.Context,
	span rcmgr.ResourceScopeSpan)

func (*UploadModular) ReserveResource

func (u *UploadModular) ReserveResource(
	ctx context.Context,
	state *rcmgr.ScopeStat) (
	rcmgr.ResourceScopeSpan, error)

func (*UploadModular) Start

func (u *UploadModular) Start(ctx context.Context) error

func (*UploadModular) Stop

func (u *UploadModular) Stop(ctx context.Context) error

Jump to

Keyboard shortcuts

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