Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultUploaderOptions(uploader *UploadModular, cfg *gfspconfig.GfSpConfig) error
- func NewUploadModular(app *gfspapp.GfSpBaseApp, cfg *gfspconfig.GfSpConfig) (coremodule.Modular, error)
- func StreamReadAt(stream io.Reader, b []byte) (int, error)
- type UploadModular
- func (u *UploadModular) HandleUploadObjectTask(ctx context.Context, uploadObjectTask coretask.UploadObjectTask, ...) error
- func (u *UploadModular) Name() string
- func (u *UploadModular) PostUploadObject(ctx context.Context, uploadObjectTask coretask.UploadObjectTask)
- func (u *UploadModular) PreUploadObject(ctx context.Context, uploadObjectTask coretask.UploadObjectTask) error
- func (u *UploadModular) QueryTasks(ctx context.Context, subKey coretask.TKey) ([]coretask.Task, error)
- func (u *UploadModular) ReleaseResource(ctx context.Context, span rcmgr.ResourceScopeSpan)
- func (u *UploadModular) ReserveResource(ctx context.Context, state *rcmgr.ScopeStat) (rcmgr.ResourceScopeSpan, error)
- func (u *UploadModular) Start(ctx context.Context) error
- func (u *UploadModular) Stop(ctx context.Context) error
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)
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 (*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)
Click to show internal directories.
Click to hide internal directories.