put

package
v4.2.0-alpha1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HashFunc = func() hash.Hash {
	return hasher.NewBlockHash(simd.MD5(), hasher.DefaultBlockSize)
}

Functions

func WithHashInterceptor added in v4.0.1

func WithHashInterceptor() nodes.Option

func WithPutInterceptor

func WithPutInterceptor() nodes.Option

func WithUploadLimiter

func WithUploadLimiter() nodes.Option

Types

type Handler

type Handler struct {
	abstract.Handler
	// contains filtered or unexported fields
}

Handler handles Put requests by creating temporary files in the index before forwarding data to the object service. This temporary entry is updated later on by the sync service, once the object is written. It is deleted if the Put operation fails.

func (*Handler) Adapt

func (m *Handler) Adapt(c nodes.Handler, options nodes.RouterOptions) nodes.Handler

func (*Handler) CreateNode

CreateNode recursively creates parents if they do not already exist Only applicable to COLLECTION inside a structured storage (need to create .pydio hidden files)

func (*Handler) MultipartAbort

func (m *Handler) MultipartAbort(ctx context.Context, target *tree.Node, uploadID string, requestData *models.MultipartRequestData) error

func (*Handler) MultipartComplete added in v4.0.1

func (m *Handler) MultipartComplete(ctx context.Context, target *tree.Node, uploadID string, uploadedParts []models.MultipartObjectPart) (models.ObjectInfo, error)

func (*Handler) MultipartCreate

func (m *Handler) MultipartCreate(ctx context.Context, node *tree.Node, requestData *models.MultipartRequestData) (string, error)

MultipartCreate registers a node in the virtual fs with size 0 and ETag: temporary (we do not have the real size at this point because we are using streams.)

func (*Handler) MultipartPutObjectPart added in v4.0.1

func (m *Handler) MultipartPutObjectPart(ctx context.Context, target *tree.Node, uploadID string, partNumberMarker int, reader io.Reader, requestData *models.PutRequestData) (models.MultipartObjectPart, error)

func (*Handler) PutObject

func (m *Handler) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, requestData *models.PutRequestData) (models.ObjectInfo, error)

PutObject eventually creates an index Node, captures body to extract Mime Type and compute custom Hash

type HashHandler added in v4.0.1

type HashHandler struct {
	abstract.Handler
	// contains filtered or unexported fields
}

HashHandler wraps input readers to compute custom Hash on the fly

func (*HashHandler) Adapt added in v4.0.1

func (m *HashHandler) Adapt(c nodes.Handler, options nodes.RouterOptions) nodes.Handler

func (*HashHandler) CopyObject added in v4.0.1

func (m *HashHandler) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, requestData *models.CopyRequestData) (models.ObjectInfo, error)

CopyObject propagates x-cells-hash metadata when copying or moving files

func (*HashHandler) CreateNode added in v4.0.1

CreateNode optionally replaces ETag value with the custom x-cells-hash metadata

func (*HashHandler) ListNodes added in v4.0.1

ListNodes optionally replaces ETag value with the custom x-cells-hash metadata

func (*HashHandler) MultipartAbort added in v4.0.1

func (m *HashHandler) MultipartAbort(ctx context.Context, target *tree.Node, uploadID string, requestData *models.MultipartRequestData) error

MultipartAbort clears parts stored in cache on multipart cancellation

func (*HashHandler) MultipartComplete added in v4.0.1

func (m *HashHandler) MultipartComplete(ctx context.Context, target *tree.Node, uploadID string, uploadedParts []models.MultipartObjectPart) (models.ObjectInfo, error)

MultipartComplete reconstructs final hash from the parts hashes stored in cache

func (*HashHandler) MultipartPutObjectPart added in v4.0.1

func (m *HashHandler) MultipartPutObjectPart(ctx context.Context, target *tree.Node, uploadID string, partNumberMarker int, reader io.Reader, requestData *models.PutRequestData) (models.MultipartObjectPart, error)

MultipartPutObjectPart intercepts PutObjectPart to compute custom hash on-the-fly and store this parts hash in cache

func (*HashHandler) PutObject added in v4.0.1

func (m *HashHandler) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, requestData *models.PutRequestData) (models.ObjectInfo, error)

PutObject intercepts PutObject to compute custom hash on-the-fly

func (*HashHandler) ReadNode added in v4.0.1

ReadNode optionally replaces ETag value with the custom x-cells-hash metadata

func (*HashHandler) StreamChanges added in v4.0.1

StreamChanges optionally replaces ETag value with the custom x-cells-hash metadata

func (*HashHandler) UpdateNode added in v4.0.1

UpdateNode optionally replaces ETag value with the custom x-cells-hash metadata

type UploadLimitFilter

type UploadLimitFilter struct {
	abstract.Handler
}

UploadLimitFilter restricts atomic uploads by extension and maximum size, based on the front plugins configuration.

func (*UploadLimitFilter) Adapt

func (*UploadLimitFilter) MultipartPutObjectPart

func (a *UploadLimitFilter) MultipartPutObjectPart(ctx context.Context, target *tree.Node, uploadID string, partNumberMarker int, reader io.Reader, requestData *models.PutRequestData) (models.MultipartObjectPart, error)

MultipartPutObjectPart checks Upload Limits (size, extension) defined in the frontend on MultipartPutObjectPart

func (*UploadLimitFilter) PutObject

func (a *UploadLimitFilter) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, requestData *models.PutRequestData) (models.ObjectInfo, error)

PutObject checks Upload Limits (size, extension) defined in the frontend on PutObject operation

Jump to

Keyboard shortcuts

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