Documentation ¶
Overview ¶
Package views provides high-level clients for talking to the main data tree in certain context.
It follows the "wrapper" pattern of http handlers to filter all requests inputs and outputs. The "Router" is object is used by all services or gateways when accessing to data as a given user. Between others, it will - Load ACLs and perform checks to make sure user is allowed to read/write the data - Perform other meta-related or acl-related checks like Quota management, locks, etc.. - Perform encryption/decryption of actual data on the fly - Compress / Decompress archives, - Add metadata collected from any services on the nodes outputted by the responses, - etc...
Index ¶
- Constants
- Variables
- func AccessListFromContext(ctx context.Context) (*permissions.AccessList, error)
- func AncestorsListFromContext(ctx context.Context, node *tree.Node, identifier string, p SourcesPool, ...) (updatedContext context.Context, parentsList []*tree.Node, e error)
- func BuildAncestorsList(ctx context.Context, treeClient tree.NodeProviderClient, node *tree.Node) (parentUuids []*tree.Node, err error)
- func BuildAncestorsListOrParent(ctx context.Context, treeClient tree.NodeProviderClient, node *tree.Node) (parentUuids []*tree.Node, err error)
- func CopyMoveNodes(ctx context.Context, router Handler, sourceNode *tree.Node, ...) (oErr error)
- func GetGenericStoreClient(ctx context.Context, storeNamespace string, microClient client.Client) (client *minio.Core, bucket string, e error)
- func GetGenericStoreClientConfig(storeNamespace string) (dataSource string, bucket string, e error)
- func GetSessionID(ctx context.Context) (string, bool)
- func NewCacheDiff() *cacheDiff
- func NewMockNodeKeyManagerClient() encryption.NodeKeyManagerClient
- func NewMockUserKeyTool() key.UserKeyTool
- func UserWorkspacesFromContext(ctx context.Context) map[string]*idm.Workspace
- func WalkFilterSkipPydioHiddenFile(ctx context.Context, node *tree.Node) bool
- func WithBranchInfo(ctx context.Context, identifier string, branchInfo BranchInfo, reset ...bool) context.Context
- func WithSessionID(ctx context.Context, session string) context.Context
- type AbstractBranchFilter
- func (v *AbstractBranchFilter) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, ...) (int64, error)
- func (v *AbstractBranchFilter) CreateNode(ctx context.Context, in *tree.CreateNodeRequest, opts ...client.CallOption) (*tree.CreateNodeResponse, error)
- func (v *AbstractBranchFilter) DeleteNode(ctx context.Context, in *tree.DeleteNodeRequest, opts ...client.CallOption) (*tree.DeleteNodeResponse, error)
- func (v *AbstractBranchFilter) ExecuteWrapped(inputFilter NodeFilter, outputFilter NodeFilter, provider NodesCallback) error
- func (v *AbstractBranchFilter) GetObject(ctx context.Context, node *tree.Node, requestData *GetRequestData) (io.ReadCloser, error)
- func (v *AbstractBranchFilter) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (streamer tree.NodeProvider_ListNodesClient, e error)
- func (v *AbstractBranchFilter) MultipartAbort(ctx context.Context, node *tree.Node, uploadID string, ...) error
- func (v *AbstractBranchFilter) MultipartComplete(ctx context.Context, node *tree.Node, uploadID string, ...) (minio.ObjectInfo, error)
- func (v *AbstractBranchFilter) MultipartCreate(ctx context.Context, node *tree.Node, requestData *MultipartRequestData) (string, error)
- func (v *AbstractBranchFilter) MultipartListObjectParts(ctx context.Context, node *tree.Node, uploadID string, partNumberMarker int, ...) (lpi minio.ListObjectPartsResult, er error)
- func (v *AbstractBranchFilter) MultipartPutObjectPart(ctx context.Context, node *tree.Node, uploadID string, partNumberMarker int, ...) (minio.ObjectPart, error)
- func (v *AbstractBranchFilter) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, ...) (int64, error)
- func (v *AbstractBranchFilter) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
- func (v *AbstractBranchFilter) StreamChanges(ctx context.Context, in *tree.StreamChangesRequest, opts ...client.CallOption) (tree.NodeChangesStreamer_StreamChangesClient, error)
- func (v *AbstractBranchFilter) UpdateNode(ctx context.Context, in *tree.UpdateNodeRequest, opts ...client.CallOption) (*tree.UpdateNodeResponse, error)
- type AbstractHandler
- func (a *AbstractHandler) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, ...) (int64, error)
- func (a *AbstractHandler) CreateNode(ctx context.Context, in *tree.CreateNodeRequest, opts ...client.CallOption) (*tree.CreateNodeResponse, error)
- func (a *AbstractHandler) DeleteNode(ctx context.Context, in *tree.DeleteNodeRequest, opts ...client.CallOption) (*tree.DeleteNodeResponse, error)
- func (a *AbstractHandler) ExecuteWrapped(inputFilter NodeFilter, outputFilter NodeFilter, provider NodesCallback) error
- func (a *AbstractHandler) GetObject(ctx context.Context, node *tree.Node, requestData *GetRequestData) (io.ReadCloser, error)
- func (a *AbstractHandler) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (tree.NodeProvider_ListNodesClient, error)
- func (a *AbstractHandler) ListNodesWithCallback(ctx context.Context, request *tree.ListNodesRequest, callback WalkFunc, ...) error
- func (a *AbstractHandler) MultipartAbort(ctx context.Context, target *tree.Node, uploadID string, ...) error
- func (a *AbstractHandler) MultipartComplete(ctx context.Context, target *tree.Node, uploadID string, ...) (minio.ObjectInfo, error)
- func (a *AbstractHandler) MultipartCreate(ctx context.Context, target *tree.Node, requestData *MultipartRequestData) (string, error)
- func (a *AbstractHandler) MultipartList(ctx context.Context, prefix string, requestData *MultipartRequestData) (minio.ListMultipartUploadsResult, error)
- func (a *AbstractHandler) MultipartListObjectParts(ctx context.Context, target *tree.Node, uploadID string, partNumberMarker int, ...) (minio.ListObjectPartsResult, error)
- func (a *AbstractHandler) MultipartPutObjectPart(ctx context.Context, target *tree.Node, uploadID string, partNumberMarker int, ...) (minio.ObjectPart, error)
- func (a *AbstractHandler) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, ...) (int64, error)
- func (a *AbstractHandler) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
- func (a *AbstractHandler) SetClientsPool(p SourcesPool)
- func (a *AbstractHandler) SetNextHandler(h Handler)
- func (a *AbstractHandler) StreamChanges(ctx context.Context, in *tree.StreamChangesRequest, opts ...client.CallOption) (tree.NodeChangesStreamer_StreamChangesClient, error)
- func (a *AbstractHandler) UpdateNode(ctx context.Context, in *tree.UpdateNodeRequest, opts ...client.CallOption) (*tree.UpdateNodeResponse, error)
- func (a *AbstractHandler) WrappedCanApply(srcCtx context.Context, targetCtx context.Context, ...) error
- type AccessListHandler
- type AclContentLockFilter
- func (a *AclContentLockFilter) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, ...) (int64, error)
- func (a *AclContentLockFilter) MultipartCreate(ctx context.Context, target *tree.Node, requestData *MultipartRequestData) (string, error)
- func (a *AclContentLockFilter) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, ...) (int64, error)
- func (a *AclContentLockFilter) WrappedCanApply(srcCtx context.Context, targetCtx context.Context, ...) error
- type AclFilterHandler
- func (a *AclFilterHandler) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, ...) (int64, error)
- func (a *AclFilterHandler) CreateNode(ctx context.Context, in *tree.CreateNodeRequest, opts ...client.CallOption) (*tree.CreateNodeResponse, error)
- func (a *AclFilterHandler) DeleteNode(ctx context.Context, in *tree.DeleteNodeRequest, opts ...client.CallOption) (*tree.DeleteNodeResponse, error)
- func (a *AclFilterHandler) GetObject(ctx context.Context, node *tree.Node, requestData *GetRequestData) (io.ReadCloser, error)
- func (a *AclFilterHandler) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (streamer tree.NodeProvider_ListNodesClient, e error)
- func (a *AclFilterHandler) MultipartCreate(ctx context.Context, node *tree.Node, requestData *MultipartRequestData) (string, error)
- func (a *AclFilterHandler) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, ...) (int64, error)
- func (a *AclFilterHandler) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
- func (a *AclFilterHandler) UpdateNode(ctx context.Context, in *tree.UpdateNodeRequest, opts ...client.CallOption) (*tree.UpdateNodeResponse, error)
- func (a *AclFilterHandler) WrappedCanApply(srcCtx context.Context, targetCtx context.Context, ...) error
- type AclLockFilter
- func (a *AclLockFilter) MultipartCreate(ctx context.Context, node *tree.Node, requestData *MultipartRequestData) (string, error)
- func (a *AclLockFilter) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, ...) (int64, error)
- func (a *AclLockFilter) WrappedCanApply(srcCtx context.Context, targetCtx context.Context, ...) error
- type AclQuotaFilter
- func (a *AclQuotaFilter) ComputeQuota(ctx context.Context, workspace *idm.Workspace) (quota int64, usage int64, err error)
- func (a *AclQuotaFilter) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, ...) (int64, error)
- func (a *AclQuotaFilter) FindParentWorkspaces(ctx context.Context, workspace *idm.Workspace) (parentWorkspaces []*idm.Workspace, parentContext context.Context, err error)
- func (a *AclQuotaFilter) MultipartPutObjectPart(ctx context.Context, target *tree.Node, uploadID string, partNumberMarker int, ...) (minio.ObjectPart, error)
- func (a *AclQuotaFilter) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, ...) (int64, error)
- func (a *AclQuotaFilter) QuotaForWorkspace(ctx context.Context, workspace *idm.Workspace, orderedRoles []string) (maxQuota int64, currentUsage int64, err error)
- func (a *AclQuotaFilter) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
- func (a *AclQuotaFilter) WrappedCanApply(srcCtx context.Context, targetCtx context.Context, ...) error
- type ArchiveHandler
- func (a *ArchiveHandler) GetObject(ctx context.Context, node *tree.Node, requestData *GetRequestData) (io.ReadCloser, error)
- func (a *ArchiveHandler) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (tree.NodeProvider_ListNodesClient, error)
- func (a *ArchiveHandler) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
- type ArchiveReader
- func (a *ArchiveReader) ExtractAllTar(ctx context.Context, gzipFormat bool, archiveNode *tree.Node, ...) error
- func (a *ArchiveReader) ExtractAllZip(ctx context.Context, archiveNode *tree.Node, targetNode *tree.Node, ...) error
- func (a *ArchiveReader) ListChildrenTar(ctx context.Context, gzipFormat bool, archiveNode *tree.Node, ...) ([]*tree.Node, error)
- func (a *ArchiveReader) ListChildrenZip(ctx context.Context, archiveNode *tree.Node, parentPath string, stat ...bool) ([]*tree.Node, error)
- func (a *ArchiveReader) ReadChildTar(ctx context.Context, gzipFormat bool, writer io.WriteCloser, ...) (int64, error)
- func (a *ArchiveReader) ReadChildZip(ctx context.Context, archiveNode *tree.Node, innerPath string) (io.ReadCloser, error)
- func (a *ArchiveReader) StatChildTar(ctx context.Context, gzipFormat bool, archiveNode *tree.Node, innerPath string) (*tree.Node, error)
- func (a *ArchiveReader) StatChildZip(ctx context.Context, archiveNode *tree.Node, innerPath string) (*tree.Node, error)
- type ArchiveWriter
- type BinaryStoreHandler
- func (a *BinaryStoreHandler) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, ...) (int64, error)
- func (a *BinaryStoreHandler) CreateNode(ctx context.Context, in *tree.CreateNodeRequest, opts ...client.CallOption) (*tree.CreateNodeResponse, error)
- func (a *BinaryStoreHandler) DeleteNode(ctx context.Context, in *tree.DeleteNodeRequest, opts ...client.CallOption) (*tree.DeleteNodeResponse, error)
- func (a *BinaryStoreHandler) GetObject(ctx context.Context, node *tree.Node, requestData *GetRequestData) (io.ReadCloser, error)
- func (a *BinaryStoreHandler) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (c tree.NodeProvider_ListNodesClient, e error)
- func (a *BinaryStoreHandler) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, ...) (int64, error)
- func (a *BinaryStoreHandler) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
- func (a *BinaryStoreHandler) UpdateNode(ctx context.Context, in *tree.UpdateNodeRequest, opts ...client.CallOption) (*tree.UpdateNodeResponse, error)
- type BranchInfo
- type ChangesWrappingStreamer
- func (l ChangesWrappingStreamer) Close() error
- func (l *ChangesWrappingStreamer) Recv() (*tree.NodeChangeEvent, error)
- func (l ChangesWrappingStreamer) RecvMsg(m interface{}) error
- func (l ChangesWrappingStreamer) Send(in interface{}) error
- func (l ChangesWrappingStreamer) SendError(err error) error
- func (l ChangesWrappingStreamer) SendMsg(msg interface{}) error
- type ClientsPool
- func (p *ClientsPool) Close()
- func (p *ClientsPool) GetDataSourceInfo(dsName string, retries ...int) (LoadedSource, error)
- func (p *ClientsPool) GetDataSources() map[string]LoadedSource
- func (p *ClientsPool) GetTreeClient() tree.NodeProviderClient
- func (p *ClientsPool) GetTreeClientWrite() tree.NodeReceiverClient
- func (p *ClientsPool) LoadDataSources()
- type ContextWrapper
- type CopyRequestData
- type CtxKeepAccessListKey
- type CtxUserAccessListKey
- type EncryptionHandler
- func (e *EncryptionHandler) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, ...) (int64, error)
- func (e *EncryptionHandler) GetObject(ctx context.Context, node *tree.Node, requestData *GetRequestData) (io.ReadCloser, error)
- func (e *EncryptionHandler) MultipartCreate(ctx context.Context, target *tree.Node, requestData *MultipartRequestData) (string, error)
- func (e *EncryptionHandler) MultipartPutObjectPart(ctx context.Context, target *tree.Node, uploadID string, partNumberMarker int, ...) (minio.ObjectPart, error)
- func (e *EncryptionHandler) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, ...) (int64, error)
- func (e *EncryptionHandler) SetNodeKeyManagerClient(nodeKeyManagerClient encryption.NodeKeyManagerClient)
- func (e *EncryptionHandler) SetUserKeyTool(keyTool key.UserKeyTool)
- type Executor
- func (e *Executor) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, ...) (int64, error)
- func (e *Executor) CreateNode(ctx context.Context, in *tree.CreateNodeRequest, opts ...client.CallOption) (*tree.CreateNodeResponse, error)
- func (e *Executor) DeleteNode(ctx context.Context, in *tree.DeleteNodeRequest, opts ...client.CallOption) (*tree.DeleteNodeResponse, error)
- func (a *Executor) ExecuteWrapped(inputFilter NodeFilter, outputFilter NodeFilter, provider NodesCallback) error
- func (e *Executor) GetObject(ctx context.Context, node *tree.Node, requestData *GetRequestData) (io.ReadCloser, error)
- func (e *Executor) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (tree.NodeProvider_ListNodesClient, error)
- func (e *Executor) MultipartAbort(ctx context.Context, target *tree.Node, uploadID string, ...) error
- func (e *Executor) MultipartComplete(ctx context.Context, target *tree.Node, uploadID string, ...) (minio.ObjectInfo, error)
- func (e *Executor) MultipartCreate(ctx context.Context, target *tree.Node, requestData *MultipartRequestData) (string, error)
- func (e *Executor) MultipartList(ctx context.Context, prefix string, requestData *MultipartRequestData) (res minio.ListMultipartUploadsResult, err error)
- func (e *Executor) MultipartListObjectParts(ctx context.Context, target *tree.Node, uploadID string, partNumberMarker int, ...) (lpi minio.ListObjectPartsResult, err error)
- func (e *Executor) MultipartPutObjectPart(ctx context.Context, target *tree.Node, uploadID string, partNumberMarker int, ...) (minio.ObjectPart, error)
- func (e *Executor) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, ...) (int64, error)
- func (e *Executor) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
- func (e *Executor) StreamChanges(ctx context.Context, in *tree.StreamChangesRequest, opts ...client.CallOption) (tree.NodeChangesStreamer_StreamChangesClient, error)
- func (e *Executor) UpdateNode(ctx context.Context, in *tree.UpdateNodeRequest, opts ...client.CallOption) (*tree.UpdateNodeResponse, error)
- func (e *Executor) WrappedCanApply(_ context.Context, _ context.Context, _ *tree.NodeChangeEvent) error
- type GetRequestData
- type Handler
- type HandlerAuditEvent
- func (h *HandlerAuditEvent) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, ...) (int64, error)
- func (h *HandlerAuditEvent) CreateNode(ctx context.Context, in *tree.CreateNodeRequest, opts ...client.CallOption) (*tree.CreateNodeResponse, error)
- func (h *HandlerAuditEvent) DeleteNode(ctx context.Context, in *tree.DeleteNodeRequest, opts ...client.CallOption) (*tree.DeleteNodeResponse, error)
- func (h *HandlerAuditEvent) GetObject(ctx context.Context, node *tree.Node, requestData *GetRequestData) (io.ReadCloser, error)
- func (h *HandlerAuditEvent) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (tree.NodeProvider_ListNodesClient, error)
- func (h *HandlerAuditEvent) MultipartAbort(ctx context.Context, target *tree.Node, uploadID string, ...) error
- func (h *HandlerAuditEvent) MultipartComplete(ctx context.Context, target *tree.Node, uploadID string, ...) (minio.ObjectInfo, error)
- func (h *HandlerAuditEvent) MultipartCreate(ctx context.Context, target *tree.Node, requestData *MultipartRequestData) (string, error)
- func (h *HandlerAuditEvent) MultipartList(ctx context.Context, prefix string, requestData *MultipartRequestData) (minio.ListMultipartUploadsResult, error)
- func (h *HandlerAuditEvent) MultipartListObjectParts(ctx context.Context, target *tree.Node, uploadID string, partNumberMarker int, ...) (minio.ListObjectPartsResult, error)
- func (h *HandlerAuditEvent) MultipartPutObjectPart(ctx context.Context, target *tree.Node, uploadID string, partNumberMarker int, ...) (minio.ObjectPart, error)
- func (h *HandlerAuditEvent) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, ...) (int64, error)
- func (h *HandlerAuditEvent) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
- func (h *HandlerAuditEvent) UpdateNode(ctx context.Context, in *tree.UpdateNodeRequest, opts ...client.CallOption) (*tree.UpdateNodeResponse, error)
- type HandlerEventRead
- type HandlerMock
- func (h *HandlerMock) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, ...) (int64, error)
- func (h *HandlerMock) CreateNode(ctx context.Context, in *tree.CreateNodeRequest, opts ...client.CallOption) (*tree.CreateNodeResponse, error)
- func (h *HandlerMock) DeleteNode(ctx context.Context, in *tree.DeleteNodeRequest, opts ...client.CallOption) (*tree.DeleteNodeResponse, error)
- func (h *HandlerMock) ExecuteWrapped(inputFilter NodeFilter, outputFilter NodeFilter, provider NodesCallback) error
- func (h *HandlerMock) GetObject(ctx context.Context, node *tree.Node, requestData *GetRequestData) (io.ReadCloser, error)
- func (h *HandlerMock) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (tree.NodeProvider_ListNodesClient, error)
- func (h *HandlerMock) ListNodesWithCallback(ctx context.Context, request *tree.ListNodesRequest, callback WalkFunc, ...) error
- func (h *HandlerMock) MultipartAbort(ctx context.Context, target *tree.Node, uploadID string, ...) error
- func (h *HandlerMock) MultipartComplete(ctx context.Context, target *tree.Node, uploadID string, ...) (minio.ObjectInfo, error)
- func (h *HandlerMock) MultipartCreate(ctx context.Context, target *tree.Node, requestData *MultipartRequestData) (string, error)
- func (h *HandlerMock) MultipartList(ctx context.Context, prefix string, requestData *MultipartRequestData) (minio.ListMultipartUploadsResult, error)
- func (h *HandlerMock) MultipartListObjectParts(ctx context.Context, target *tree.Node, uploadID string, partNumberMarker int, ...) (minio.ListObjectPartsResult, error)
- func (h *HandlerMock) MultipartPutObjectPart(ctx context.Context, target *tree.Node, uploadID string, partNumberMarker int, ...) (op minio.ObjectPart, e error)
- func (h *HandlerMock) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, ...) (int64, error)
- func (h *HandlerMock) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
- func (h *HandlerMock) SetClientsPool(p SourcesPool)
- func (h *HandlerMock) SetNextHandler(handler Handler)
- func (h *HandlerMock) StreamChanges(ctx context.Context, in *tree.StreamChangesRequest, opts ...client.CallOption) (tree.NodeChangesStreamer_StreamChangesClient, error)
- func (h *HandlerMock) UpdateNode(ctx context.Context, in *tree.UpdateNodeRequest, opts ...client.CallOption) (*tree.UpdateNodeResponse, error)
- func (h *HandlerMock) WrappedCanApply(srcCtx context.Context, targetCtx context.Context, ...) error
- type LoadedSource
- type MockReadCloser
- type MultipartRequestData
- type MultipleRootsHandler
- func (m *MultipleRootsHandler) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (tree.NodeProvider_ListNodesClient, error)
- func (m *MultipleRootsHandler) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
- type NodeFilter
- type NodeWrappingStreamer
- func (l NodeWrappingStreamer) Close() error
- func (n *NodeWrappingStreamer) Recv() (*tree.ListNodesResponse, error)
- func (l NodeWrappingStreamer) RecvMsg(m interface{}) error
- func (l NodeWrappingStreamer) Send(in interface{}) error
- func (l NodeWrappingStreamer) SendError(err error) error
- func (l NodeWrappingStreamer) SendMsg(msg interface{}) error
- type NodesCallback
- type PathDataSourceHandler
- type PathWorkspaceHandler
- func (a *PathWorkspaceHandler) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (tree.NodeProvider_ListNodesClient, error)
- func (a *PathWorkspaceHandler) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
- type PutHandler
- func (m *PutHandler) CreateParent(ctx context.Context, node *tree.Node) error
- func (m *PutHandler) GetOrCreatePutNode(ctx context.Context, nodePath string, size int64) (*tree.Node, error, onCreateErrorFunc)
- func (m *PutHandler) MultipartAbort(ctx context.Context, target *tree.Node, uploadID string, ...) error
- func (m *PutHandler) MultipartCreate(ctx context.Context, node *tree.Node, requestData *MultipartRequestData) (string, error)
- func (m *PutHandler) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, ...) (int64, error)
- type PutRequestData
- type Router
- func (v *Router) CanApply(ctx context.Context, operation *tree.NodeChangeEvent) (*tree.NodeChangeEvent, error)
- func (v *Router) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, ...) (int64, error)
- func (v *Router) CreateNode(ctx context.Context, in *tree.CreateNodeRequest, opts ...client.CallOption) (*tree.CreateNodeResponse, error)
- func (v *Router) DeleteNode(ctx context.Context, in *tree.DeleteNodeRequest, opts ...client.CallOption) (*tree.DeleteNodeResponse, error)
- func (v *Router) ExecuteWrapped(inputFilter NodeFilter, outputFilter NodeFilter, provider NodesCallback) error
- func (v *Router) GetClientsPool() SourcesPool
- func (v *Router) GetExecutor() Handler
- func (v *Router) GetObject(ctx context.Context, node *tree.Node, requestData *GetRequestData) (io.ReadCloser, error)
- func (v *Router) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (tree.NodeProvider_ListNodesClient, error)
- func (v *Router) ListNodesWithCallback(ctx context.Context, request *tree.ListNodesRequest, callback WalkFunc, ...) error
- func (v *Router) MultipartAbort(ctx context.Context, target *tree.Node, uploadID string, ...) error
- func (v *Router) MultipartComplete(ctx context.Context, target *tree.Node, uploadID string, ...) (minio.ObjectInfo, error)
- func (v *Router) MultipartCreate(ctx context.Context, target *tree.Node, requestData *MultipartRequestData) (string, error)
- func (v *Router) MultipartList(ctx context.Context, prefix string, requestData *MultipartRequestData) (minio.ListMultipartUploadsResult, error)
- func (v *Router) MultipartListObjectParts(ctx context.Context, target *tree.Node, uploadID string, partNumberMarker int, ...) (minio.ListObjectPartsResult, error)
- func (v *Router) MultipartPutObjectPart(ctx context.Context, target *tree.Node, uploadID string, partNumberMarker int, ...) (minio.ObjectPart, error)
- func (v *Router) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, ...) (int64, error)
- func (v *Router) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
- func (v *Router) SetClientsPool(SourcesPool)
- func (v *Router) SetNextHandler(Handler)
- func (v *Router) StreamChanges(ctx context.Context, in *tree.StreamChangesRequest, opts ...client.CallOption) (tree.NodeChangesStreamer_StreamChangesClient, error)
- func (v *Router) UpdateNode(ctx context.Context, in *tree.UpdateNodeRequest, opts ...client.CallOption) (*tree.UpdateNodeResponse, error)
- func (v *Router) WrapCallback(provider NodesCallback) error
- func (v *Router) WrappedCanApply(srcCtx context.Context, targetCtx context.Context, ...) error
- type RouterEventFilter
- type RouterOptions
- type SourcesPool
- type SyncFolderTasksHandler
- func (h *SyncFolderTasksHandler) DeleteNode(ctx context.Context, in *tree.DeleteNodeRequest, opts ...client.CallOption) (*tree.DeleteNodeResponse, error)
- func (h *SyncFolderTasksHandler) UpdateNode(ctx context.Context, in *tree.UpdateNodeRequest, opts ...client.CallOption) (*tree.UpdateNodeResponse, error)
- type SynchronousCacheHandler
- func (s *SynchronousCacheHandler) CreateNode(ctx context.Context, in *tree.CreateNodeRequest, opts ...client.CallOption) (*tree.CreateNodeResponse, error)
- func (s *SynchronousCacheHandler) DeleteNode(ctx context.Context, in *tree.DeleteNodeRequest, opts ...client.CallOption) (*tree.DeleteNodeResponse, error)
- func (s *SynchronousCacheHandler) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (tree.NodeProvider_ListNodesClient, error)
- func (s *SynchronousCacheHandler) MultipartComplete(ctx context.Context, target *tree.Node, uploadID string, ...) (minio.ObjectInfo, error)
- func (s *SynchronousCacheHandler) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, ...) (int64, error)
- func (s *SynchronousCacheHandler) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
- func (s *SynchronousCacheHandler) UpdateNode(ctx context.Context, in *tree.UpdateNodeRequest, opts ...client.CallOption) (*tree.UpdateNodeResponse, error)
- type UploadLimitFilter
- type UuidDataSourceHandler
- type UuidNodeHandler
- type VersionHandler
- func (v *VersionHandler) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, ...) (int64, error)
- func (v *VersionHandler) GetObject(ctx context.Context, node *tree.Node, requestData *GetRequestData) (io.ReadCloser, error)
- func (v *VersionHandler) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (tree.NodeProvider_ListNodesClient, error)
- func (v *VersionHandler) ReadNode(ctx context.Context, req *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
- type VirtualNodesBrowser
- func (v *VirtualNodesBrowser) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (streamer tree.NodeProvider_ListNodesClient, e error)
- func (v *VirtualNodesBrowser) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
- type VirtualNodesManager
- func (m *VirtualNodesManager) ByPath(path string) (*tree.Node, bool)
- func (m *VirtualNodesManager) ByUuid(uuid string) (*tree.Node, bool)
- func (m *VirtualNodesManager) GetResolver(pool SourcesPool, createIfNotExists bool) func(context.Context, *tree.Node) (*tree.Node, bool)
- func (m *VirtualNodesManager) ListNodes() []*tree.Node
- func (m *VirtualNodesManager) Load(forceReload ...bool)
- func (m *VirtualNodesManager) ResolveInContext(ctx context.Context, vNode *tree.Node, clientsPool SourcesPool, create bool, ...) (*tree.Node, error)
- type VirtualNodesResolver
- type WalkFilter
- type WalkFunc
- type WorkspaceRootResolver
Constants ¶
const (
VIEWS_LIBRARY_NAME = "pydio.lib.views"
)
Variables ¶
var ( // IsUnitTestEnv flag prevents among others the ClientPool to look for declared // datasources in the registry. As none is present while running unit tests, it // otherwise times out. IsUnitTestEnv = false )
Functions ¶
func AccessListFromContext ¶
func AccessListFromContext(ctx context.Context) (*permissions.AccessList, error)
func BuildAncestorsList ¶
func BuildAncestorsList(ctx context.Context, treeClient tree.NodeProviderClient, node *tree.Node) (parentUuids []*tree.Node, err error)
BuildAncestorsList uses ListNodes with "Ancestors" flag to build the list of parent nodes. It uses an internal short-lived cache to throttle calls to the TreeService
func BuildAncestorsListOrParent ¶
func BuildAncestorsListOrParent(ctx context.Context, treeClient tree.NodeProviderClient, node *tree.Node) (parentUuids []*tree.Node, err error)
BuildAncestorsListOrParent builds ancestors list when the node does not exists yet, by trying to find all existing parents.
func CopyMoveNodes ¶ added in v1.5.0
func CopyMoveNodes(ctx context.Context, router Handler, sourceNode *tree.Node, targetNode *tree.Node, move bool, recursive bool, isTask bool, statusChan chan string, progressChan chan float32, tFunc ...i18n.TranslateFunc) (oErr error)
CopyMoveNodes performs a recursive copy or move operation of a node to a new location. It can be inter- or intra-datasources. It will eventually pass contextual metadata like X-Pydio-Session (to batch event inside the SYNC) or X-Pydio-Move (to reconciliate creates and deletes when move is done between two differing datasources).
func GetGenericStoreClient ¶
func GetGenericStoreClient(ctx context.Context, storeNamespace string, microClient client.Client) (client *minio.Core, bucket string, e error)
GetGenericStoreClient creates a *minio.Core client for a given binary store.
func GetGenericStoreClientConfig ¶
GetGenericStoreClientConfig finds datasource/bucket for a given store.
func GetSessionID ¶
GetSessionID returns the session ID in context
func NewCacheDiff ¶ added in v1.5.0
func NewCacheDiff() *cacheDiff
func NewMockNodeKeyManagerClient ¶ added in v1.5.0
func NewMockNodeKeyManagerClient() encryption.NodeKeyManagerClient
func NewMockUserKeyTool ¶ added in v1.5.0
func NewMockUserKeyTool() key.UserKeyTool
func WithBranchInfo ¶
Types ¶
type AbstractBranchFilter ¶
type AbstractBranchFilter struct { AbstractHandler RootNodesCache *cache.Cache // contains filtered or unexported fields }
AbstractBranchFilter is a ready-made Handler that can be used by all handlers that just modify the path in one way or another before forwarding calls to next handler.
func (*AbstractBranchFilter) CopyObject ¶
func (v *AbstractBranchFilter) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, requestData *CopyRequestData) (int64, error)
func (*AbstractBranchFilter) CreateNode ¶
func (v *AbstractBranchFilter) CreateNode(ctx context.Context, in *tree.CreateNodeRequest, opts ...client.CallOption) (*tree.CreateNodeResponse, error)
func (*AbstractBranchFilter) DeleteNode ¶
func (v *AbstractBranchFilter) DeleteNode(ctx context.Context, in *tree.DeleteNodeRequest, opts ...client.CallOption) (*tree.DeleteNodeResponse, error)
func (*AbstractBranchFilter) ExecuteWrapped ¶
func (v *AbstractBranchFilter) ExecuteWrapped(inputFilter NodeFilter, outputFilter NodeFilter, provider NodesCallback) error
func (*AbstractBranchFilter) GetObject ¶
func (v *AbstractBranchFilter) GetObject(ctx context.Context, node *tree.Node, requestData *GetRequestData) (io.ReadCloser, error)
func (*AbstractBranchFilter) ListNodes ¶
func (v *AbstractBranchFilter) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (streamer tree.NodeProvider_ListNodesClient, e error)
func (*AbstractBranchFilter) MultipartAbort ¶
func (v *AbstractBranchFilter) MultipartAbort(ctx context.Context, node *tree.Node, uploadID string, requestData *MultipartRequestData) error
func (*AbstractBranchFilter) MultipartComplete ¶
func (*AbstractBranchFilter) MultipartCreate ¶
func (v *AbstractBranchFilter) MultipartCreate(ctx context.Context, node *tree.Node, requestData *MultipartRequestData) (string, error)
func (*AbstractBranchFilter) MultipartListObjectParts ¶
func (*AbstractBranchFilter) MultipartPutObjectPart ¶
func (*AbstractBranchFilter) PutObject ¶
func (v *AbstractBranchFilter) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, requestData *PutRequestData) (int64, error)
func (*AbstractBranchFilter) ReadNode ¶
func (v *AbstractBranchFilter) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
func (*AbstractBranchFilter) StreamChanges ¶
func (v *AbstractBranchFilter) StreamChanges(ctx context.Context, in *tree.StreamChangesRequest, opts ...client.CallOption) (tree.NodeChangesStreamer_StreamChangesClient, error)
func (*AbstractBranchFilter) UpdateNode ¶
func (v *AbstractBranchFilter) UpdateNode(ctx context.Context, in *tree.UpdateNodeRequest, opts ...client.CallOption) (*tree.UpdateNodeResponse, error)
type AbstractHandler ¶
type AbstractHandler struct { CtxWrapper ContextWrapper // contains filtered or unexported fields }
AbstractHandler provides the simplest implementation of Handler and forwards all calls to the next handler
func (*AbstractHandler) CopyObject ¶
func (a *AbstractHandler) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, requestData *CopyRequestData) (int64, error)
func (*AbstractHandler) CreateNode ¶
func (a *AbstractHandler) CreateNode(ctx context.Context, in *tree.CreateNodeRequest, opts ...client.CallOption) (*tree.CreateNodeResponse, error)
func (*AbstractHandler) DeleteNode ¶
func (a *AbstractHandler) DeleteNode(ctx context.Context, in *tree.DeleteNodeRequest, opts ...client.CallOption) (*tree.DeleteNodeResponse, error)
func (*AbstractHandler) ExecuteWrapped ¶
func (a *AbstractHandler) ExecuteWrapped(inputFilter NodeFilter, outputFilter NodeFilter, provider NodesCallback) error
func (*AbstractHandler) GetObject ¶
func (a *AbstractHandler) GetObject(ctx context.Context, node *tree.Node, requestData *GetRequestData) (io.ReadCloser, error)
func (*AbstractHandler) ListNodes ¶
func (a *AbstractHandler) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (tree.NodeProvider_ListNodesClient, error)
func (*AbstractHandler) ListNodesWithCallback ¶
func (a *AbstractHandler) ListNodesWithCallback(ctx context.Context, request *tree.ListNodesRequest, callback WalkFunc, ignoreCbError bool, filters ...WalkFilter) error
func (*AbstractHandler) MultipartAbort ¶
func (a *AbstractHandler) MultipartAbort(ctx context.Context, target *tree.Node, uploadID string, requestData *MultipartRequestData) error
func (*AbstractHandler) MultipartComplete ¶
func (*AbstractHandler) MultipartCreate ¶
func (a *AbstractHandler) MultipartCreate(ctx context.Context, target *tree.Node, requestData *MultipartRequestData) (string, error)
func (*AbstractHandler) MultipartList ¶
func (a *AbstractHandler) MultipartList(ctx context.Context, prefix string, requestData *MultipartRequestData) (minio.ListMultipartUploadsResult, error)
func (*AbstractHandler) MultipartListObjectParts ¶
func (*AbstractHandler) MultipartPutObjectPart ¶
func (*AbstractHandler) PutObject ¶
func (a *AbstractHandler) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, requestData *PutRequestData) (int64, error)
func (*AbstractHandler) ReadNode ¶
func (a *AbstractHandler) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
func (*AbstractHandler) SetClientsPool ¶
func (a *AbstractHandler) SetClientsPool(p SourcesPool)
func (*AbstractHandler) SetNextHandler ¶
func (a *AbstractHandler) SetNextHandler(h Handler)
func (*AbstractHandler) StreamChanges ¶
func (a *AbstractHandler) StreamChanges(ctx context.Context, in *tree.StreamChangesRequest, opts ...client.CallOption) (tree.NodeChangesStreamer_StreamChangesClient, error)
func (*AbstractHandler) UpdateNode ¶
func (a *AbstractHandler) UpdateNode(ctx context.Context, in *tree.UpdateNodeRequest, opts ...client.CallOption) (*tree.UpdateNodeResponse, error)
func (*AbstractHandler) WrappedCanApply ¶
func (a *AbstractHandler) WrappedCanApply(srcCtx context.Context, targetCtx context.Context, operation *tree.NodeChangeEvent) error
type AccessListHandler ¶
type AccessListHandler struct {
AbstractHandler
}
AccessListHandler appends permissions.AccessList to the context.
func NewAccessListHandler ¶
func NewAccessListHandler(adminView bool) *AccessListHandler
NewAccessListHandler creates a new AccessListHandler
type AclContentLockFilter ¶
type AclContentLockFilter struct {
AbstractHandler
}
AclContentLockFilter checks for user-defined content locks in the context AccessList.
func (*AclContentLockFilter) CopyObject ¶
func (a *AclContentLockFilter) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, requestData *CopyRequestData) (int64, error)
CopyObject should check: quota on CopyObject operation? Can we copy an object on top of an existing node?
func (*AclContentLockFilter) MultipartCreate ¶
func (a *AclContentLockFilter) MultipartCreate(ctx context.Context, target *tree.Node, requestData *MultipartRequestData) (string, error)
func (*AclContentLockFilter) PutObject ¶
func (a *AclContentLockFilter) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, requestData *PutRequestData) (int64, error)
PutObject check locks before allowing Put operation.
func (*AclContentLockFilter) WrappedCanApply ¶
func (a *AclContentLockFilter) WrappedCanApply(srcCtx context.Context, targetCtx context.Context, operation *tree.NodeChangeEvent) error
type AclFilterHandler ¶
type AclFilterHandler struct {
AbstractHandler
}
AclFilterHandler checks for read/write permissions depending on the call using the context AccessList.
func (*AclFilterHandler) CopyObject ¶
func (a *AclFilterHandler) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, requestData *CopyRequestData) (int64, error)
func (*AclFilterHandler) CreateNode ¶
func (a *AclFilterHandler) CreateNode(ctx context.Context, in *tree.CreateNodeRequest, opts ...client.CallOption) (*tree.CreateNodeResponse, error)
func (*AclFilterHandler) DeleteNode ¶
func (a *AclFilterHandler) DeleteNode(ctx context.Context, in *tree.DeleteNodeRequest, opts ...client.CallOption) (*tree.DeleteNodeResponse, error)
func (*AclFilterHandler) GetObject ¶
func (a *AclFilterHandler) GetObject(ctx context.Context, node *tree.Node, requestData *GetRequestData) (io.ReadCloser, error)
func (*AclFilterHandler) ListNodes ¶
func (a *AclFilterHandler) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (streamer tree.NodeProvider_ListNodesClient, e error)
func (*AclFilterHandler) MultipartCreate ¶
func (a *AclFilterHandler) MultipartCreate(ctx context.Context, node *tree.Node, requestData *MultipartRequestData) (string, error)
func (*AclFilterHandler) PutObject ¶
func (a *AclFilterHandler) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, requestData *PutRequestData) (int64, error)
func (*AclFilterHandler) ReadNode ¶
func (a *AclFilterHandler) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
Check if node is readable and forward to next middleware
func (*AclFilterHandler) UpdateNode ¶
func (a *AclFilterHandler) UpdateNode(ctx context.Context, in *tree.UpdateNodeRequest, opts ...client.CallOption) (*tree.UpdateNodeResponse, error)
func (*AclFilterHandler) WrappedCanApply ¶
func (a *AclFilterHandler) WrappedCanApply(srcCtx context.Context, targetCtx context.Context, operation *tree.NodeChangeEvent) error
type AclLockFilter ¶
type AclLockFilter struct {
AbstractHandler
}
AclLockFilter filters call by checking internal locks.
func (*AclLockFilter) MultipartCreate ¶
func (a *AclLockFilter) MultipartCreate(ctx context.Context, node *tree.Node, requestData *MultipartRequestData) (string, error)
func (*AclLockFilter) PutObject ¶
func (a *AclLockFilter) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, requestData *PutRequestData) (int64, error)
PutObject check locks before allowing Put operation.
func (*AclLockFilter) WrappedCanApply ¶
func (a *AclLockFilter) WrappedCanApply(srcCtx context.Context, targetCtx context.Context, operation *tree.NodeChangeEvent) error
WrappedCanApply will perform checks on quota to make sure an operation is authorized
type AclQuotaFilter ¶
type AclQuotaFilter struct { AbstractHandler // contains filtered or unexported fields }
AclQuotaFilter applies storage quota limitation on a per-workspace basis.
func (*AclQuotaFilter) ComputeQuota ¶
func (a *AclQuotaFilter) ComputeQuota(ctx context.Context, workspace *idm.Workspace) (quota int64, usage int64, err error)
ComputeQuota finds quota and current usage for a given workspace
func (*AclQuotaFilter) CopyObject ¶
func (a *AclQuotaFilter) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, requestData *CopyRequestData) (int64, error)
CopyObject checks quota on CopyObject operation.
func (*AclQuotaFilter) FindParentWorkspaces ¶
func (a *AclQuotaFilter) FindParentWorkspaces(ctx context.Context, workspace *idm.Workspace) (parentWorkspaces []*idm.Workspace, parentContext context.Context, err error)
FindParentWorkspaces finds possible parents for the current workspace based on the RESOURCE_OWNER uuid.
func (*AclQuotaFilter) MultipartPutObjectPart ¶
func (a *AclQuotaFilter) MultipartPutObjectPart(ctx context.Context, target *tree.Node, uploadID string, partNumberMarker int, reader io.Reader, requestData *PutRequestData) (minio.ObjectPart, error)
MultipartPutObjectPart checks quota on MultipartPutObjectPart.
func (*AclQuotaFilter) PutObject ¶
func (a *AclQuotaFilter) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, requestData *PutRequestData) (int64, error)
PutObject checks quota on PutObject operation.
func (*AclQuotaFilter) QuotaForWorkspace ¶
func (a *AclQuotaFilter) QuotaForWorkspace(ctx context.Context, workspace *idm.Workspace, orderedRoles []string) (maxQuota int64, currentUsage int64, err error)
QuotaForWorkspace finds quota and computes current usage from ACLs and Tree for a given workspace, in a specific context given by the orderedRoles list.
func (*AclQuotaFilter) ReadNode ¶
func (a *AclQuotaFilter) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
ReadNode append quota info on workspace roots
func (*AclQuotaFilter) WrappedCanApply ¶
func (a *AclQuotaFilter) WrappedCanApply(srcCtx context.Context, targetCtx context.Context, operation *tree.NodeChangeEvent) error
WrappedCanApply will perform checks on quota to make sure an operation is authorized
type ArchiveHandler ¶
type ArchiveHandler struct { AbstractHandler // contains filtered or unexported fields }
ArchiveHandler dynamically create archives when downloading folders and supports archive contents listing.
func NewArchiveHandler ¶ added in v1.2.1
func NewArchiveHandler() *ArchiveHandler
NewArchiveHandler creates a new ArchiveHandler
func (*ArchiveHandler) GetObject ¶
func (a *ArchiveHandler) GetObject(ctx context.Context, node *tree.Node, requestData *GetRequestData) (io.ReadCloser, error)
Override the response of GetObject if it is sent on a folder key : create an archive on-the-fly.
func (*ArchiveHandler) ListNodes ¶
func (a *ArchiveHandler) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (tree.NodeProvider_ListNodesClient, error)
func (*ArchiveHandler) ReadNode ¶
func (a *ArchiveHandler) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
Override the response of ReadNode to create a fake stat for archive file
type ArchiveReader ¶
type ArchiveReader struct {
Router Handler
}
func (*ArchiveReader) ExtractAllTar ¶
func (a *ArchiveReader) ExtractAllTar(ctx context.Context, gzipFormat bool, archiveNode *tree.Node, targetNode *tree.Node, logChannels ...chan string) error
ExtractAllTar extracts all files contained in a tar/tar.gz archive to a given location
func (*ArchiveReader) ExtractAllZip ¶
func (a *ArchiveReader) ExtractAllZip(ctx context.Context, archiveNode *tree.Node, targetNode *tree.Node, logChannels ...chan string) error
ExtractAllZip extracts all files contained in a zip archive to a given location
func (*ArchiveReader) ListChildrenTar ¶
func (a *ArchiveReader) ListChildrenTar(ctx context.Context, gzipFormat bool, archiveNode *tree.Node, parentPath string, stat ...bool) ([]*tree.Node, error)
ListChildrenTar extracts all children from a tar/tar.gz archive
func (*ArchiveReader) ListChildrenZip ¶
func (a *ArchiveReader) ListChildrenZip(ctx context.Context, archiveNode *tree.Node, parentPath string, stat ...bool) ([]*tree.Node, error)
ListChildrenZip extracts all children from a zip archive
func (*ArchiveReader) ReadChildTar ¶
func (a *ArchiveReader) ReadChildTar(ctx context.Context, gzipFormat bool, writer io.WriteCloser, archiveNode *tree.Node, innerPath string) (int64, error)
ReadChildTar reads content of a file contained in a tar/tar.gz archive
func (*ArchiveReader) ReadChildZip ¶
func (a *ArchiveReader) ReadChildZip(ctx context.Context, archiveNode *tree.Node, innerPath string) (io.ReadCloser, error)
ReadChildZip reads content of a file contained in a zip archive
type ArchiveWriter ¶
type ArchiveWriter struct { Router Handler // Optional filter when listing nodes to build the archive WalkFilter WalkFilter }
type BinaryStoreHandler ¶
type BinaryStoreHandler struct { AbstractHandler StoreName string AllowPut bool AllowAnonRead bool }
BinaryStoreHandler captures put/get calls to an internal storage
func (*BinaryStoreHandler) CopyObject ¶
func (a *BinaryStoreHandler) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, requestData *CopyRequestData) (int64, error)
func (*BinaryStoreHandler) CreateNode ¶
func (a *BinaryStoreHandler) CreateNode(ctx context.Context, in *tree.CreateNodeRequest, opts ...client.CallOption) (*tree.CreateNodeResponse, error)
///////////////////////////// THIS STORE IS NOT WRITEABLE /////////////////////////////
func (*BinaryStoreHandler) DeleteNode ¶
func (a *BinaryStoreHandler) DeleteNode(ctx context.Context, in *tree.DeleteNodeRequest, opts ...client.CallOption) (*tree.DeleteNodeResponse, error)
func (*BinaryStoreHandler) GetObject ¶
func (a *BinaryStoreHandler) GetObject(ctx context.Context, node *tree.Node, requestData *GetRequestData) (io.ReadCloser, error)
func (*BinaryStoreHandler) ListNodes ¶
func (a *BinaryStoreHandler) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (c tree.NodeProvider_ListNodesClient, e error)
Listing of Thumbs Store : do not display content
func (*BinaryStoreHandler) PutObject ¶
func (a *BinaryStoreHandler) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, requestData *PutRequestData) (int64, error)
func (*BinaryStoreHandler) ReadNode ¶
func (a *BinaryStoreHandler) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
Node Info & Node Content : send by UUID,
func (*BinaryStoreHandler) UpdateNode ¶
func (a *BinaryStoreHandler) UpdateNode(ctx context.Context, in *tree.UpdateNodeRequest, opts ...client.CallOption) (*tree.UpdateNodeResponse, error)
type BranchInfo ¶
type BranchInfo struct { LoadedSource idm.Workspace Root *tree.Node Binary bool AncestorsList map[string][]*tree.Node }
These keys may be enriched in Context depending on the middleware
func GetBranchInfo ¶
func GetBranchInfo(ctx context.Context, identifier string) (BranchInfo, bool)
type ChangesWrappingStreamer ¶
type ChangesWrappingStreamer struct {
// contains filtered or unexported fields
}
func NewChangesWrappingStreamer ¶
func NewChangesWrappingStreamer() *ChangesWrappingStreamer
func (*ChangesWrappingStreamer) Recv ¶
func (l *ChangesWrappingStreamer) Recv() (*tree.NodeChangeEvent, error)
func (ChangesWrappingStreamer) RecvMsg ¶
func (l ChangesWrappingStreamer) RecvMsg(m interface{}) error
type ClientsPool ¶
type ClientsPool struct {
// contains filtered or unexported fields
}
ClientsPool is responsible for discovering available datasources and keeping an up to date registry that is used by the routers.
func NewClientsPool ¶
func NewClientsPool(watchRegistry bool) *ClientsPool
NewClientsPool creates a client pool and initialises it by calling the registry.
func (*ClientsPool) Close ¶
func (p *ClientsPool) Close()
Close stops the underlying watcher if defined.
func (*ClientsPool) GetDataSourceInfo ¶
func (p *ClientsPool) GetDataSourceInfo(dsName string, retries ...int) (LoadedSource, error)
GetDataSourceInfo tries to find information about a DataSource, eventually retrying as DataSource could be currently starting and not yet registered in the ClientsPool.
func (*ClientsPool) GetDataSources ¶
func (p *ClientsPool) GetDataSources() map[string]LoadedSource
GetDataSources returns currently loaded datasources
func (*ClientsPool) GetTreeClient ¶
func (p *ClientsPool) GetTreeClient() tree.NodeProviderClient
GetTreeClient returns the internal NodeProviderClient pointing to the TreeService.
func (*ClientsPool) GetTreeClientWrite ¶
func (p *ClientsPool) GetTreeClientWrite() tree.NodeReceiverClient
GetTreeClientWrite returns the internal NodeReceiverClient pointing to the TreeService.
func (*ClientsPool) LoadDataSources ¶
func (p *ClientsPool) LoadDataSources()
LoadDataSources queries the registry to reload available datasources
type CopyRequestData ¶
These keys may be enriched in Context depending on the middleware
type CtxKeepAccessListKey ¶ added in v1.2.4
type CtxKeepAccessListKey struct{}
These keys may be enriched in Context depending on the middleware
type CtxUserAccessListKey ¶ added in v1.4.0
type CtxUserAccessListKey struct{}
These keys may be enriched in Context depending on the middleware
type EncryptionHandler ¶
type EncryptionHandler struct { AbstractHandler // contains filtered or unexported fields }
EncryptionHandler encryption node middleware
func (*EncryptionHandler) CopyObject ¶
func (e *EncryptionHandler) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, requestData *CopyRequestData) (int64, error)
CopyObject enriches request metadata for CopyObject with Encryption Materials, if required by the datasource
func (*EncryptionHandler) GetObject ¶
func (e *EncryptionHandler) GetObject(ctx context.Context, node *tree.Node, requestData *GetRequestData) (io.ReadCloser, error)
GetObject enriches request metadata for GetObject with Encryption Materials, if required by the datasource.
func (*EncryptionHandler) MultipartCreate ¶ added in v1.6.0
func (e *EncryptionHandler) MultipartCreate(ctx context.Context, target *tree.Node, requestData *MultipartRequestData) (string, error)
func (*EncryptionHandler) MultipartPutObjectPart ¶ added in v1.2.2
func (*EncryptionHandler) PutObject ¶
func (e *EncryptionHandler) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, requestData *PutRequestData) (int64, error)
PutObject enriches request metadata for PutObject with Encryption Materials, if required by datasource.
func (*EncryptionHandler) SetNodeKeyManagerClient ¶ added in v1.5.0
func (e *EncryptionHandler) SetNodeKeyManagerClient(nodeKeyManagerClient encryption.NodeKeyManagerClient)
func (*EncryptionHandler) SetUserKeyTool ¶ added in v1.5.0
func (e *EncryptionHandler) SetUserKeyTool(keyTool key.UserKeyTool)
type Executor ¶
type Executor struct {
AbstractHandler
}
Executor is the final handler: it does not have a "next" handler, but actually performs all requests.
func (*Executor) CopyObject ¶
func (*Executor) CreateNode ¶
func (e *Executor) CreateNode(ctx context.Context, in *tree.CreateNodeRequest, opts ...client.CallOption) (*tree.CreateNodeResponse, error)
func (*Executor) DeleteNode ¶
func (e *Executor) DeleteNode(ctx context.Context, in *tree.DeleteNodeRequest, opts ...client.CallOption) (*tree.DeleteNodeResponse, error)
func (*Executor) ExecuteWrapped ¶
func (a *Executor) ExecuteWrapped(inputFilter NodeFilter, outputFilter NodeFilter, provider NodesCallback) error
func (*Executor) GetObject ¶
func (e *Executor) GetObject(ctx context.Context, node *tree.Node, requestData *GetRequestData) (io.ReadCloser, error)
func (*Executor) ListNodes ¶
func (e *Executor) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (tree.NodeProvider_ListNodesClient, error)
func (*Executor) MultipartAbort ¶
func (*Executor) MultipartComplete ¶
func (*Executor) MultipartCreate ¶
func (*Executor) MultipartList ¶
func (*Executor) MultipartListObjectParts ¶
func (*Executor) MultipartPutObjectPart ¶
func (*Executor) ReadNode ¶
func (e *Executor) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
func (*Executor) StreamChanges ¶
func (e *Executor) StreamChanges(ctx context.Context, in *tree.StreamChangesRequest, opts ...client.CallOption) (tree.NodeChangesStreamer_StreamChangesClient, error)
func (*Executor) UpdateNode ¶
func (e *Executor) UpdateNode(ctx context.Context, in *tree.UpdateNodeRequest, opts ...client.CallOption) (*tree.UpdateNodeResponse, error)
func (*Executor) WrappedCanApply ¶
type GetRequestData ¶
These keys may be enriched in Context depending on the middleware
type Handler ¶
type Handler interface { tree.NodeProviderClient tree.NodeReceiverClient tree.NodeChangesStreamerClient GetObject(ctx context.Context, node *tree.Node, requestData *GetRequestData) (io.ReadCloser, error) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, requestData *PutRequestData) (int64, error) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, requestData *CopyRequestData) (int64, error) MultipartCreate(ctx context.Context, target *tree.Node, requestData *MultipartRequestData) (string, error) MultipartPutObjectPart(ctx context.Context, target *tree.Node, uploadID string, partNumberMarker int, reader io.Reader, requestData *PutRequestData) (minio.ObjectPart, error) MultipartList(ctx context.Context, prefix string, requestData *MultipartRequestData) (minio.ListMultipartUploadsResult, error) MultipartAbort(ctx context.Context, target *tree.Node, uploadID string, requestData *MultipartRequestData) error MultipartComplete(ctx context.Context, target *tree.Node, uploadID string, uploadedParts []minio.CompletePart) (minio.ObjectInfo, error) MultipartListObjectParts(ctx context.Context, target *tree.Node, uploadID string, partNumberMarker int, maxParts int) (minio.ListObjectPartsResult, error) ExecuteWrapped(inputFilter NodeFilter, outputFilter NodeFilter, provider NodesCallback) error WrappedCanApply(srcCtx context.Context, targetCtx context.Context, operation *tree.NodeChangeEvent) error ListNodesWithCallback(ctx context.Context, request *tree.ListNodesRequest, callback WalkFunc, ignoreCbError bool, filters ...WalkFilter) error SetNextHandler(h Handler) SetClientsPool(p SourcesPool) }
type HandlerAuditEvent ¶
type HandlerAuditEvent struct {
AbstractHandler
}
HandlerAuditEvent is responsible for auditing all events on Nodes as soon as the router's option flag "AuditEvent" is set to true.
func (*HandlerAuditEvent) CopyObject ¶
func (h *HandlerAuditEvent) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, requestData *CopyRequestData) (int64, error)
func (*HandlerAuditEvent) CreateNode ¶
func (h *HandlerAuditEvent) CreateNode(ctx context.Context, in *tree.CreateNodeRequest, opts ...client.CallOption) (*tree.CreateNodeResponse, error)
CreateNode logs an audit message on each call after having transferred the call to following handlers.
func (*HandlerAuditEvent) DeleteNode ¶
func (h *HandlerAuditEvent) DeleteNode(ctx context.Context, in *tree.DeleteNodeRequest, opts ...client.CallOption) (*tree.DeleteNodeResponse, error)
DeleteNode logs an audit message on each call after having transferred the call to following handlers.
func (*HandlerAuditEvent) GetObject ¶
func (h *HandlerAuditEvent) GetObject(ctx context.Context, node *tree.Node, requestData *GetRequestData) (io.ReadCloser, error)
GetObject logs an audit message on each GetObject Events after calling following handlers.
func (*HandlerAuditEvent) ListNodes ¶
func (h *HandlerAuditEvent) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (tree.NodeProvider_ListNodesClient, error)
ListNodes logs an audit message on each call after having transferred the call to following handlers.
func (*HandlerAuditEvent) MultipartAbort ¶
func (h *HandlerAuditEvent) MultipartAbort(ctx context.Context, target *tree.Node, uploadID string, requestData *MultipartRequestData) error
func (*HandlerAuditEvent) MultipartComplete ¶
func (h *HandlerAuditEvent) MultipartComplete(ctx context.Context, target *tree.Node, uploadID string, uploadedParts []minio.CompletePart) (minio.ObjectInfo, error)
func (*HandlerAuditEvent) MultipartCreate ¶
func (h *HandlerAuditEvent) MultipartCreate(ctx context.Context, target *tree.Node, requestData *MultipartRequestData) (string, error)
func (*HandlerAuditEvent) MultipartList ¶
func (h *HandlerAuditEvent) MultipartList(ctx context.Context, prefix string, requestData *MultipartRequestData) (minio.ListMultipartUploadsResult, error)
func (*HandlerAuditEvent) MultipartListObjectParts ¶
func (*HandlerAuditEvent) MultipartPutObjectPart ¶
func (h *HandlerAuditEvent) MultipartPutObjectPart(ctx context.Context, target *tree.Node, uploadID string, partNumberMarker int, reader io.Reader, requestData *PutRequestData) (minio.ObjectPart, error)
func (*HandlerAuditEvent) PutObject ¶
func (h *HandlerAuditEvent) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, requestData *PutRequestData) (int64, error)
PutObject logs an audit message after calling following handlers.
func (*HandlerAuditEvent) ReadNode ¶
func (h *HandlerAuditEvent) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
ReadNode only forwards call to next handler, it call too often to provide useful audit info.
func (*HandlerAuditEvent) UpdateNode ¶
func (h *HandlerAuditEvent) UpdateNode(ctx context.Context, in *tree.UpdateNodeRequest, opts ...client.CallOption) (*tree.UpdateNodeResponse, error)
UpdateNode logs an audit message on each call after having transferred the call to following handlers.
type HandlerEventRead ¶
type HandlerEventRead struct {
AbstractHandler
}
HandlerEventRead publishes events after reading files.
func (*HandlerEventRead) GetObject ¶
func (h *HandlerEventRead) GetObject(ctx context.Context, node *tree.Node, requestData *GetRequestData) (io.ReadCloser, error)
func (*HandlerEventRead) ListNodes ¶
func (h *HandlerEventRead) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (tree.NodeProvider_ListNodesClient, error)
type HandlerMock ¶
func NewHandlerMock ¶
func NewHandlerMock() *HandlerMock
func (*HandlerMock) CopyObject ¶
func (h *HandlerMock) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, requestData *CopyRequestData) (int64, error)
func (*HandlerMock) CreateNode ¶
func (h *HandlerMock) CreateNode(ctx context.Context, in *tree.CreateNodeRequest, opts ...client.CallOption) (*tree.CreateNodeResponse, error)
func (*HandlerMock) DeleteNode ¶
func (h *HandlerMock) DeleteNode(ctx context.Context, in *tree.DeleteNodeRequest, opts ...client.CallOption) (*tree.DeleteNodeResponse, error)
func (*HandlerMock) ExecuteWrapped ¶
func (h *HandlerMock) ExecuteWrapped(inputFilter NodeFilter, outputFilter NodeFilter, provider NodesCallback) error
func (*HandlerMock) GetObject ¶
func (h *HandlerMock) GetObject(ctx context.Context, node *tree.Node, requestData *GetRequestData) (io.ReadCloser, error)
func (*HandlerMock) ListNodes ¶
func (h *HandlerMock) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (tree.NodeProvider_ListNodesClient, error)
func (*HandlerMock) ListNodesWithCallback ¶
func (h *HandlerMock) ListNodesWithCallback(ctx context.Context, request *tree.ListNodesRequest, callback WalkFunc, ignoreCbError bool, filters ...WalkFilter) error
func (*HandlerMock) MultipartAbort ¶
func (h *HandlerMock) MultipartAbort(ctx context.Context, target *tree.Node, uploadID string, requestData *MultipartRequestData) error
func (*HandlerMock) MultipartComplete ¶
func (*HandlerMock) MultipartCreate ¶
func (h *HandlerMock) MultipartCreate(ctx context.Context, target *tree.Node, requestData *MultipartRequestData) (string, error)
func (*HandlerMock) MultipartList ¶
func (h *HandlerMock) MultipartList(ctx context.Context, prefix string, requestData *MultipartRequestData) (minio.ListMultipartUploadsResult, error)
func (*HandlerMock) MultipartListObjectParts ¶
func (*HandlerMock) MultipartPutObjectPart ¶
func (*HandlerMock) PutObject ¶
func (h *HandlerMock) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, requestData *PutRequestData) (int64, error)
func (*HandlerMock) ReadNode ¶
func (h *HandlerMock) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
func (*HandlerMock) SetClientsPool ¶
func (h *HandlerMock) SetClientsPool(p SourcesPool)
func (*HandlerMock) SetNextHandler ¶
func (h *HandlerMock) SetNextHandler(handler Handler)
func (*HandlerMock) StreamChanges ¶
func (h *HandlerMock) StreamChanges(ctx context.Context, in *tree.StreamChangesRequest, opts ...client.CallOption) (tree.NodeChangesStreamer_StreamChangesClient, error)
func (*HandlerMock) UpdateNode ¶
func (h *HandlerMock) UpdateNode(ctx context.Context, in *tree.UpdateNodeRequest, opts ...client.CallOption) (*tree.UpdateNodeResponse, error)
func (*HandlerMock) WrappedCanApply ¶
func (h *HandlerMock) WrappedCanApply(srcCtx context.Context, targetCtx context.Context, operation *tree.NodeChangeEvent) error
type LoadedSource ¶
type LoadedSource struct { object.DataSource Client *minio.Core }
These keys may be enriched in Context depending on the middleware
func NewSource ¶
func NewSource(data *object.DataSource) (LoadedSource, error)
NewSource instantiates a LoadedSource with a minio client
func WithBucketName ¶
func WithBucketName(s LoadedSource, bucket string) LoadedSource
WithBucketName creates a copy of a LoadedSource with a bucket name
func (LoadedSource) MarshalLogObject ¶
func (s LoadedSource) MarshalLogObject(encoder zapcore.ObjectEncoder) error
type MockReadCloser ¶
func (MockReadCloser) Close ¶
func (r MockReadCloser) Close() error
type MultipartRequestData ¶
type MultipartRequestData struct { Metadata map[string]string ListKeyMarker string ListUploadIDMarker string ListDelimiter string ListMaxUploads int }
These keys may be enriched in Context depending on the middleware
type MultipleRootsHandler ¶
type MultipleRootsHandler struct {
AbstractBranchFilter
}
MultipleRootsHandler handle special case of multiple-roots workspaces.
func NewPathMultipleRootsHandler ¶
func NewPathMultipleRootsHandler() *MultipleRootsHandler
func (*MultipleRootsHandler) ListNodes ¶
func (m *MultipleRootsHandler) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (tree.NodeProvider_ListNodesClient, error)
func (*MultipleRootsHandler) ReadNode ¶
func (m *MultipleRootsHandler) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
type NodeFilter ¶
type NodeWrappingStreamer ¶
type NodeWrappingStreamer struct {
// contains filtered or unexported fields
}
NodeWrappingStreamer wraps an existing Node Streamer.
func NewWrappingStreamer ¶
func NewWrappingStreamer() *NodeWrappingStreamer
func (*NodeWrappingStreamer) Recv ¶
func (n *NodeWrappingStreamer) Recv() (*tree.ListNodesResponse, error)
type NodesCallback ¶
type NodesCallback func(inputFilter NodeFilter, outputFilter NodeFilter) error
type PathDataSourceHandler ¶
type PathDataSourceHandler struct {
AbstractBranchFilter
}
PathDataSourceHandler is an AbstractBranchFilter adding/extracting datasource name from the path.
func NewPathDataSourceHandler ¶
func NewPathDataSourceHandler() *PathDataSourceHandler
type PathWorkspaceHandler ¶
type PathWorkspaceHandler struct {
AbstractBranchFilter
}
PathWorkspaceHandler is an AbstractBranchFilter extracting workspace and managing path inside the workspace.
func NewPathWorkspaceHandler ¶
func NewPathWorkspaceHandler() *PathWorkspaceHandler
func (*PathWorkspaceHandler) ListNodes ¶
func (a *PathWorkspaceHandler) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (tree.NodeProvider_ListNodesClient, error)
func (*PathWorkspaceHandler) ReadNode ¶
func (a *PathWorkspaceHandler) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
type PutHandler ¶
type PutHandler struct {
AbstractHandler
}
PutHandler 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 (*PutHandler) CreateParent ¶
Recursively create parents
func (*PutHandler) GetOrCreatePutNode ¶
func (m *PutHandler) GetOrCreatePutNode(ctx context.Context, nodePath string, size int64) (*tree.Node, error, onCreateErrorFunc)
Create a temporary node before calling a Put request. If it is an update, should send back the already existing node Returns the node, a flag to tell wether it is created or not, and eventually an error The Put event will afterward update the index
func (*PutHandler) MultipartAbort ¶ added in v1.2.2
func (m *PutHandler) MultipartAbort(ctx context.Context, target *tree.Node, uploadID string, requestData *MultipartRequestData) error
func (*PutHandler) MultipartCreate ¶
func (m *PutHandler) MultipartCreate(ctx context.Context, node *tree.Node, requestData *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.)
type PutRequestData ¶
type PutRequestData struct { Size int64 Md5Sum []byte Sha256Sum []byte Metadata map[string]string MultipartUploadID string MultipartPartID int }
These keys may be enriched in Context depending on the middleware
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func NewRouter ¶
func NewRouter(pool SourcesPool, handlers []Handler) *Router
NewRouter creates and configures a new router with given ClientsPool and Handlers.
func NewStandardRouter ¶
func NewStandardRouter(options RouterOptions) *Router
NewStandardRouter returns a new configured instance of the default standard router.
func NewUuidRouter ¶
func NewUuidRouter(options RouterOptions) *Router
NewUuidRouter returns a new configured instance of a router that relies on nodes UUID rather than the usual Node path.
func (*Router) CanApply ¶
func (v *Router) CanApply(ctx context.Context, operation *tree.NodeChangeEvent) (*tree.NodeChangeEvent, error)
func (*Router) CopyObject ¶
func (*Router) CreateNode ¶
func (v *Router) CreateNode(ctx context.Context, in *tree.CreateNodeRequest, opts ...client.CallOption) (*tree.CreateNodeResponse, error)
func (*Router) DeleteNode ¶
func (v *Router) DeleteNode(ctx context.Context, in *tree.DeleteNodeRequest, opts ...client.CallOption) (*tree.DeleteNodeResponse, error)
func (*Router) ExecuteWrapped ¶
func (v *Router) ExecuteWrapped(inputFilter NodeFilter, outputFilter NodeFilter, provider NodesCallback) error
func (*Router) GetExecutor ¶
GetExecutor uses the very last handler (Executor) to send a request with a previously filled context.
func (*Router) GetObject ¶
func (v *Router) GetObject(ctx context.Context, node *tree.Node, requestData *GetRequestData) (io.ReadCloser, error)
func (*Router) ListNodes ¶
func (v *Router) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (tree.NodeProvider_ListNodesClient, error)
func (*Router) ListNodesWithCallback ¶
func (v *Router) ListNodesWithCallback(ctx context.Context, request *tree.ListNodesRequest, callback WalkFunc, ignoreCbError bool, filters ...WalkFilter) error
ListNodesWithCallback performs a ListNodes request and applied callback with optional filters. This hides the complexity of streams handling.
func (*Router) MultipartAbort ¶
func (*Router) MultipartComplete ¶
func (*Router) MultipartCreate ¶
func (*Router) MultipartList ¶
func (*Router) MultipartListObjectParts ¶
func (*Router) MultipartPutObjectPart ¶
func (*Router) ReadNode ¶
func (v *Router) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
func (*Router) SetClientsPool ¶
func (v *Router) SetClientsPool(SourcesPool)
func (*Router) SetNextHandler ¶
To respect Handler interface
func (*Router) StreamChanges ¶
func (v *Router) StreamChanges(ctx context.Context, in *tree.StreamChangesRequest, opts ...client.CallOption) (tree.NodeChangesStreamer_StreamChangesClient, error)
func (*Router) UpdateNode ¶
func (v *Router) UpdateNode(ctx context.Context, in *tree.UpdateNodeRequest, opts ...client.CallOption) (*tree.UpdateNodeResponse, error)
func (*Router) WrapCallback ¶
func (v *Router) WrapCallback(provider NodesCallback) error
func (*Router) WrappedCanApply ¶
type RouterEventFilter ¶
type RouterEventFilter struct { Router RootNodesCache *cache.Cache }
Extended Router used mainly to filter events sent from inside to outside the application
func NewRouterEventFilter ¶
func NewRouterEventFilter(options RouterOptions) *RouterEventFilter
NewRouterEventFilter creates a new EventFilter properly initialized
func (*RouterEventFilter) NodeIsChildOfRoot ¶
func (r *RouterEventFilter) NodeIsChildOfRoot(ctx context.Context, node *tree.Node, rootId string) (*tree.Node, bool)
NodeIsChildOfRoot compares pathes between possible parent and child
func (*RouterEventFilter) WorkspaceCanSeeNode ¶
func (r *RouterEventFilter) WorkspaceCanSeeNode(ctx context.Context, accessList *permissions.AccessList, workspace *idm.Workspace, node *tree.Node) (*tree.Node, bool)
WorkspaceCanSeeNode will check workspaces roots to see if a node in below one of them
type RouterOptions ¶
type RouterOptions struct { AdminView bool WatchRegistry bool LogReadEvents bool BrowseVirtualNodes bool // AuditEvent flag turns audit logger ON for the corresponding router. AuditEvent bool SynchronousCache bool SynchronousTasks bool }
RouterOptions holds configuration flags to pass to a routeur constructor easily.
type SourcesPool ¶
type SourcesPool interface { Close() GetTreeClient() tree.NodeProviderClient GetTreeClientWrite() tree.NodeReceiverClient GetDataSourceInfo(dsName string, retries ...int) (LoadedSource, error) GetDataSources() map[string]LoadedSource LoadDataSources() }
These keys may be enriched in Context depending on the middleware
type SyncFolderTasksHandler ¶
type SyncFolderTasksHandler struct {
AbstractHandler
}
SyncFolderTasksHandler is a handler implementing synchronous operations for moving or deleting folders
func (*SyncFolderTasksHandler) DeleteNode ¶
func (h *SyncFolderTasksHandler) DeleteNode(ctx context.Context, in *tree.DeleteNodeRequest, opts ...client.CallOption) (*tree.DeleteNodeResponse, error)
DeleteNode synchronously and recursively delete a node
func (*SyncFolderTasksHandler) UpdateNode ¶
func (h *SyncFolderTasksHandler) UpdateNode(ctx context.Context, in *tree.UpdateNodeRequest, opts ...client.CallOption) (*tree.UpdateNodeResponse, error)
UpdateNode synchronously and recursively performs a Move operation of a node
type SynchronousCacheHandler ¶ added in v1.5.0
type SynchronousCacheHandler struct {
AbstractHandler
}
SynchronousCacheHandler maintains a cache of the nodes during modifying operations to make listings more reactive. It is used by basic APIs (like WebDAV) for better visual performances and to create pseudo-synchronous APIs.
func NewSynchronousCacheHandler ¶ added in v1.5.0
func NewSynchronousCacheHandler() *SynchronousCacheHandler
func (*SynchronousCacheHandler) CreateNode ¶ added in v1.5.0
func (s *SynchronousCacheHandler) CreateNode(ctx context.Context, in *tree.CreateNodeRequest, opts ...client.CallOption) (*tree.CreateNodeResponse, error)
func (*SynchronousCacheHandler) DeleteNode ¶ added in v1.5.0
func (s *SynchronousCacheHandler) DeleteNode(ctx context.Context, in *tree.DeleteNodeRequest, opts ...client.CallOption) (*tree.DeleteNodeResponse, error)
func (*SynchronousCacheHandler) ListNodes ¶ added in v1.5.0
func (s *SynchronousCacheHandler) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (tree.NodeProvider_ListNodesClient, error)
func (*SynchronousCacheHandler) MultipartComplete ¶ added in v1.5.0
func (*SynchronousCacheHandler) PutObject ¶ added in v1.5.0
func (s *SynchronousCacheHandler) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, requestData *PutRequestData) (int64, error)
func (*SynchronousCacheHandler) ReadNode ¶ added in v1.5.0
func (s *SynchronousCacheHandler) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
func (*SynchronousCacheHandler) UpdateNode ¶ added in v1.5.0
func (s *SynchronousCacheHandler) UpdateNode(ctx context.Context, in *tree.UpdateNodeRequest, opts ...client.CallOption) (*tree.UpdateNodeResponse, error)
type UploadLimitFilter ¶
type UploadLimitFilter struct {
AbstractHandler
}
UploadLimitFilter restricts atomic uploads by extension and maximum size, based on the front plugins configuration.
func (*UploadLimitFilter) MultipartPutObjectPart ¶
func (a *UploadLimitFilter) MultipartPutObjectPart(ctx context.Context, target *tree.Node, uploadID string, partNumberMarker int, reader io.Reader, requestData *PutRequestData) (minio.ObjectPart, error)
Check Upload Limits (size, extension) defined in the frontend on MultipartPutObjectPart
type UuidDataSourceHandler ¶
type UuidDataSourceHandler struct {
AbstractBranchFilter
}
UuidDataSourceHandler is an AbstractBranchFilter extracting datasource info based on node UUID.
func NewUuidDataSourceHandler ¶
func NewUuidDataSourceHandler() *UuidDataSourceHandler
type UuidNodeHandler ¶
type UuidNodeHandler struct {
AbstractBranchFilter
}
UuidNodeHandler is an AbstractBranchFilter extracting workspace info based on node UUID.
func NewUuidNodeHandler ¶
func NewUuidNodeHandler() *UuidNodeHandler
type VersionHandler ¶
type VersionHandler struct { AbstractHandler // contains filtered or unexported fields }
VersionHandler capture ListNodes and GetObject calls to find existing nodes versions and retrieve them.
func (*VersionHandler) CopyObject ¶
func (v *VersionHandler) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, requestData *CopyRequestData) (int64, error)
Read from Version Store if request contains a VersionID
func (*VersionHandler) GetObject ¶
func (v *VersionHandler) GetObject(ctx context.Context, node *tree.Node, requestData *GetRequestData) (io.ReadCloser, error)
Redirect to Version Store if request contains a VersionID
func (*VersionHandler) ListNodes ¶
func (v *VersionHandler) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (tree.NodeProvider_ListNodesClient, error)
Create list of nodes if the Versions are required
func (*VersionHandler) ReadNode ¶
func (v *VersionHandler) ReadNode(ctx context.Context, req *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
type VirtualNodesBrowser ¶
type VirtualNodesBrowser struct {
AbstractHandler
}
VirtualNodesBrowser is used by admin mode to list virtual nodes instead of their resolved values.
func NewVirtualNodesBrowser ¶
func NewVirtualNodesBrowser() *VirtualNodesBrowser
func (*VirtualNodesBrowser) ListNodes ¶
func (v *VirtualNodesBrowser) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...client.CallOption) (streamer tree.NodeProvider_ListNodesClient, e error)
ListNodes Append virtual nodes to the datasources list if admin is listing the root of the tree
func (*VirtualNodesBrowser) ReadNode ¶
func (v *VirtualNodesBrowser) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...client.CallOption) (*tree.ReadNodeResponse, error)
ReadNode creates a fake node if admin is reading info about a virtual node
type VirtualNodesManager ¶
type VirtualNodesManager struct {
// contains filtered or unexported fields
}
VirtualNodesManager keeps an internal list of virtual nodes. They are cached for one minute to avoid too many requests on docstore service.
func GetVirtualNodesManager ¶
func GetVirtualNodesManager() *VirtualNodesManager
GetVirtualNodesManager creates a new VirtualNodesManager.
func (*VirtualNodesManager) ByPath ¶
func (m *VirtualNodesManager) ByPath(path string) (*tree.Node, bool)
ByPath finds a VirtualNode by its Path.
func (*VirtualNodesManager) ByUuid ¶
func (m *VirtualNodesManager) ByUuid(uuid string) (*tree.Node, bool)
ByUuid finds a VirtualNode by its Uuid.
func (*VirtualNodesManager) GetResolver ¶
func (m *VirtualNodesManager) GetResolver(pool SourcesPool, createIfNotExists bool) func(context.Context, *tree.Node) (*tree.Node, bool)
GetResolver injects some dependencies to generate a simple resolver function
func (*VirtualNodesManager) ListNodes ¶
func (m *VirtualNodesManager) ListNodes() []*tree.Node
ListNodes simply returns the internally cached list.
func (*VirtualNodesManager) Load ¶
func (m *VirtualNodesManager) Load(forceReload ...bool)
Load requests the virtual nodes from the DocStore service.
func (*VirtualNodesManager) ResolveInContext ¶
func (m *VirtualNodesManager) ResolveInContext(ctx context.Context, vNode *tree.Node, clientsPool SourcesPool, create bool, retry ...bool) (*tree.Node, error)
ResolveInContext computes the actual node Path based on the resolution metadata of the virtual node and the current metadata contained in context.
type VirtualNodesResolver ¶
type VirtualNodesResolver struct {
AbstractBranchFilter
}
VirtualNodesResolver dynamically resolves virtual nodes to their runtime value.
func NewVirtualNodesHandler ¶
func NewVirtualNodesHandler() *VirtualNodesResolver
type WorkspaceRootResolver ¶
type WorkspaceRootResolver struct {
AbstractBranchFilter
}
WorkspaceRootResolver is an AbstractBranchFilter finding workspace root(s) based on the path.
func NewWorkspaceRootResolver ¶
func NewWorkspaceRootResolver() *WorkspaceRootResolver
Source Files ¶
- ancestors.go
- archive-reader.go
- archive-writer.go
- clients-pool.go
- common.go
- copy-move.go
- handler-abstract.go
- handler-access-list.go
- handler-acl-content-lock.go
- handler-acl-filter.go
- handler-acl-lock.go
- handler-acl-quota.go
- handler-archive.go
- handler-audit-events.go
- handler-binary-store.go
- handler-data-upload-limit.go
- handler-encryption-mocks.go
- handler-encryption.go
- handler-events-read.go
- handler-exec.go
- handler-mock.go
- handler-path-abstract-filter.go
- handler-path-datasource.go
- handler-path-multiple-roots.go
- handler-path-resolve-root.go
- handler-path-workspace.go
- handler-put.go
- handler-sync-cache.go
- handler-sync-folder-tasks.go
- handler-uuid-datasource.go
- handler-uuid-workspace.go
- handler-version.go
- handler-virtual-browser.go
- handler-virtual-resolver.go
- router-event-filter.go
- router-walker.go
- router.go
- storage-generic-store.go
- stream-wrappers.go
- virtual-nodes-manager.go