abstract

package
v4.4.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: AGPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AdminClientProvider func(runtime context.Context) nodes.Client
)

Functions

This section is empty.

Types

type BranchFilter

type BranchFilter struct {
	Handler
	InputMethod    nodes.FilterFunc
	OutputMethod   nodes.FilterFunc
	RootNodesCache cache.Cache
}

BranchFilter 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 (*BranchFilter) CopyObject

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

func (*BranchFilter) CreateNode

func (*BranchFilter) DeleteNode

func (*BranchFilter) ExecuteWrapped

func (v *BranchFilter) ExecuteWrapped(inputFilter nodes.FilterFunc, outputFilter nodes.FilterFunc, provider nodes.CallbackFunc) error

func (*BranchFilter) GetObject

func (v *BranchFilter) GetObject(ctx context.Context, node *tree.Node, requestData *models.GetRequestData) (io.ReadCloser, error)

func (*BranchFilter) GetRootKeys

func (v *BranchFilter) GetRootKeys(rootNodes []string) (map[string]*tree.Node, error)

func (*BranchFilter) ListNodes

func (*BranchFilter) LookupRoot

func (v *BranchFilter) LookupRoot(uuid string) (*tree.Node, error)

func (*BranchFilter) MakeRootKey

func (v *BranchFilter) MakeRootKey(rNode *tree.Node) string

func (*BranchFilter) MultipartAbort

func (v *BranchFilter) MultipartAbort(ctx context.Context, node *tree.Node, uploadID string, requestData *models.MultipartRequestData) error

func (*BranchFilter) MultipartComplete

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

func (*BranchFilter) MultipartCreate

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

func (*BranchFilter) MultipartList added in v4.0.2

func (v *BranchFilter) MultipartList(ctx context.Context, prefix string, requestData *models.MultipartRequestData) (models.ListMultipartUploadsResult, error)

func (*BranchFilter) MultipartListObjectParts

func (v *BranchFilter) MultipartListObjectParts(ctx context.Context, target *tree.Node, uploadID string, partNumberMarker int, maxParts int) (lpi models.ListObjectPartsResult, er error)

func (*BranchFilter) MultipartPutObjectPart

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

func (*BranchFilter) PutObject

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

func (*BranchFilter) ReadNode

func (*BranchFilter) UpdateNode

type ContextWrapper

type ContextWrapper func(ctx context.Context) (context.Context, error)

type Handler

type Handler struct {
	Next        nodes.Handler
	ClientsPool nodes.SourcesPool
	RuntimeCtx  context.Context
	CtxWrapper  ContextWrapper
}

Handler provides the simplest implementation of Handler and forwards all calls to the Next handler

func (*Handler) AdaptOptions

func (a *Handler) AdaptOptions(h nodes.Handler, options nodes.RouterOptions)

func (*Handler) CopyObject

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

func (*Handler) CreateNode

func (*Handler) DeleteNode

func (*Handler) ExecuteWrapped

func (a *Handler) ExecuteWrapped(inputFilter nodes.FilterFunc, outputFilter nodes.FilterFunc, provider nodes.CallbackFunc) error

func (*Handler) GetObject

func (a *Handler) GetObject(ctx context.Context, node *tree.Node, requestData *models.GetRequestData) (io.ReadCloser, error)

func (*Handler) ListNodes

func (*Handler) ListNodesWithCallback

func (a *Handler) ListNodesWithCallback(ctx context.Context, request *tree.ListNodesRequest, callback nodes.WalkFunc, ignoreCbError bool, filters ...nodes.WalkFilterFunc) error

func (*Handler) MultipartAbort

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

func (*Handler) MultipartComplete

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

func (*Handler) MultipartCreate

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

func (*Handler) MultipartList

func (a *Handler) MultipartList(ctx context.Context, prefix string, requestData *models.MultipartRequestData) (models.ListMultipartUploadsResult, error)

func (*Handler) MultipartListObjectParts

func (a *Handler) MultipartListObjectParts(ctx context.Context, target *tree.Node, uploadID string, partNumberMarker int, maxParts int) (models.ListObjectPartsResult, error)

func (*Handler) MultipartPutObjectPart

func (a *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 (a *Handler) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, requestData *models.PutRequestData) (models.ObjectInfo, error)

func (*Handler) ReadNode

func (a *Handler) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...grpc.CallOption) (*tree.ReadNodeResponse, error)

func (*Handler) SetClientsPool

func (a *Handler) SetClientsPool(p nodes.SourcesPool)

func (*Handler) SetNextHandler

func (a *Handler) SetNextHandler(h nodes.Handler)

func (*Handler) UpdateNode

func (*Handler) WrapContext

func (a *Handler) WrapContext(ctx context.Context) (context.Context, error)

func (*Handler) WrappedCanApply

func (a *Handler) WrappedCanApply(srcCtx context.Context, targetCtx context.Context, operation *tree.NodeChangeEvent) error

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(ctx context.Context) *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(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 returns a copy of 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, 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.

Jump to

Keyboard shortcuts

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