Documentation ¶
Index ¶
- Variables
- func WithHashInterceptor() nodes.Option
- func WithPutInterceptor() nodes.Option
- func WithUploadLimiter() nodes.Option
- type Handler
- func (m *Handler) Adapt(c nodes.Handler, options nodes.RouterOptions) nodes.Handler
- func (m *Handler) CreateNode(ctx context.Context, in *tree.CreateNodeRequest, opts ...grpc.CallOption) (*tree.CreateNodeResponse, error)
- func (m *Handler) MultipartAbort(ctx context.Context, target *tree.Node, uploadID string, ...) error
- func (m *Handler) MultipartComplete(ctx context.Context, target *tree.Node, uploadID string, ...) (models.ObjectInfo, error)
- func (m *Handler) MultipartCreate(ctx context.Context, node *tree.Node, requestData *models.MultipartRequestData) (string, error)
- func (m *Handler) MultipartPutObjectPart(ctx context.Context, target *tree.Node, uploadID string, partNumberMarker int, ...) (models.MultipartObjectPart, error)
- func (m *Handler) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, ...) (models.ObjectInfo, error)
- type HashHandler
- func (m *HashHandler) Adapt(c nodes.Handler, options nodes.RouterOptions) nodes.Handler
- func (m *HashHandler) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, ...) (models.ObjectInfo, error)
- func (m *HashHandler) CreateNode(ctx context.Context, in *tree.CreateNodeRequest, opts ...grpc.CallOption) (*tree.CreateNodeResponse, error)
- func (m *HashHandler) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...grpc.CallOption) (tree.NodeProvider_ListNodesClient, error)
- func (m *HashHandler) MultipartAbort(ctx context.Context, target *tree.Node, uploadID string, ...) error
- func (m *HashHandler) MultipartComplete(ctx context.Context, target *tree.Node, uploadID string, ...) (models.ObjectInfo, error)
- func (m *HashHandler) MultipartPutObjectPart(ctx context.Context, target *tree.Node, uploadID string, partNumberMarker int, ...) (models.MultipartObjectPart, error)
- func (m *HashHandler) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, ...) (models.ObjectInfo, error)
- func (m *HashHandler) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...grpc.CallOption) (*tree.ReadNodeResponse, error)
- func (m *HashHandler) StreamChanges(ctx context.Context, in *tree.StreamChangesRequest, opts ...grpc.CallOption) (tree.NodeChangesStreamer_StreamChangesClient, error)
- func (m *HashHandler) UpdateNode(ctx context.Context, in *tree.UpdateNodeRequest, opts ...grpc.CallOption) (*tree.UpdateNodeResponse, error)
- type UploadLimitFilter
- func (a *UploadLimitFilter) Adapt(c nodes.Handler, options nodes.RouterOptions) nodes.Handler
- func (a *UploadLimitFilter) MultipartPutObjectPart(ctx context.Context, target *tree.Node, uploadID string, partNumberMarker int, ...) (models.MultipartObjectPart, error)
- func (a *UploadLimitFilter) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, ...) (models.ObjectInfo, error)
Constants ¶
This section is empty.
Variables ¶
var HashFunc = func() hash.Hash { return hasher.NewBlockHash(simd.MD5(), hasher.DefaultBlockSize) }
Functions ¶
func WithHashInterceptor ¶ added in v4.0.1
func WithPutInterceptor ¶
func WithUploadLimiter ¶
Types ¶
type Handler ¶
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) CreateNode ¶
func (m *Handler) CreateNode(ctx context.Context, in *tree.CreateNodeRequest, opts ...grpc.CallOption) (*tree.CreateNodeResponse, error)
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 (*Handler) MultipartComplete ¶ added in v4.0.1
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
type HashHandler ¶ added in v4.0.1
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
func (m *HashHandler) CreateNode(ctx context.Context, in *tree.CreateNodeRequest, opts ...grpc.CallOption) (*tree.CreateNodeResponse, error)
CreateNode optionally replaces ETag value with the custom x-cells-hash metadata
func (*HashHandler) ListNodes ¶ added in v4.0.1
func (m *HashHandler) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...grpc.CallOption) (tree.NodeProvider_ListNodesClient, error)
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
func (m *HashHandler) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...grpc.CallOption) (*tree.ReadNodeResponse, error)
ReadNode optionally replaces ETag value with the custom x-cells-hash metadata
func (*HashHandler) StreamChanges ¶ added in v4.0.1
func (m *HashHandler) StreamChanges(ctx context.Context, in *tree.StreamChangesRequest, opts ...grpc.CallOption) (tree.NodeChangesStreamer_StreamChangesClient, error)
StreamChanges optionally replaces ETag value with the custom x-cells-hash metadata
func (*HashHandler) UpdateNode ¶ added in v4.0.1
func (m *HashHandler) UpdateNode(ctx context.Context, in *tree.UpdateNodeRequest, opts ...grpc.CallOption) (*tree.UpdateNodeResponse, error)
UpdateNode optionally replaces ETag value with the custom x-cells-hash metadata
type UploadLimitFilter ¶
UploadLimitFilter restricts atomic uploads by extension and maximum size, based on the front plugins configuration.
func (*UploadLimitFilter) Adapt ¶
func (a *UploadLimitFilter) Adapt(c nodes.Handler, options nodes.RouterOptions) nodes.Handler
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