uploader

package
v0.2.1-test-3 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

Variables

View Source
var (
	ErrDanglingDownloadTask = gfsperrors.Register(module.UploadModularName, http.StatusInternalServerError, 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.StatusBadRequest, 110003, "put object request repeated")
	ErrExceedTask           = gfsperrors.Register(module.UploadModularName, http.StatusServiceUnavailable, 110004, "OoooH... request exceed, try again later")
	ErrInvalidIntegrity     = gfsperrors.Register(module.UploadModularName, http.StatusNotAcceptable, 110005, "invalid payload data integrity hash")
	ErrClosedStream         = gfsperrors.Register(module.UploadModularName, http.StatusInternalServerError, 110006, "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,
	task coretask.UploadObjectTask,
	stream io.Reader) error

func (*UploadModular) Name

func (u *UploadModular) Name() string

func (*UploadModular) PostUploadObject

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

func (*UploadModular) PreUploadObject

func (u *UploadModular) PreUploadObject(
	ctx context.Context,
	task 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