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, task coretask.UploadObjectTask, stream io.Reader) error
- func (u *UploadModular) Name() string
- func (u *UploadModular) PostUploadObject(ctx context.Context, task coretask.UploadObjectTask)
- func (u *UploadModular) PreUploadObject(ctx context.Context, task 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 = 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)
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 (*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.