put

package
v5.0.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: AGPL-3.0 Imports: 34 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

func WithHashInterceptor() nodes.Option

func WithJobsDynamicMiddlewares

func WithJobsDynamicMiddlewares() nodes.Option

func WithPutInterceptor

func WithPutInterceptor() nodes.Option

func WithUploadLimiter

func WithUploadLimiter() nodes.Option

Types

type DynamicJobsHandler

type DynamicJobsHandler struct {
	abstract.Handler
}

func (*DynamicJobsHandler) Adapt

func (*DynamicJobsHandler) MultipartCreate

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

func (*DynamicJobsHandler) PutObject

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

type Handler

type Handler struct {
	abstract.BranchFilter
	// 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) CopyObject

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

CopyObject captures Copy operation (not move) to set default metadata

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) ListNodes

func (*Handler) MultipartAbort

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

func (*Handler) MultipartComplete

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

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 N, captures body to extract Mime Type and compute custom Hash

type HashHandler

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

HashHandler wraps input readers to compute custom Hash on the fly

func (*HashHandler) Adapt

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

func (*HashHandler) CopyObject

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

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

func (*HashHandler) ListNodes

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

func (*HashHandler) MultipartAbort

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

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

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

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

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

func (*HashHandler) StreamChanges

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

func (*HashHandler) UpdateNode

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