index

package
v3.0.6+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package index provides a GRPC client for storing information into any tree.NodeProviderClient/tree.NodeReceiverClient service. Typically, the index service associated to each datasource.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(dsName string, reader tree.NodeProviderClient, writer tree.NodeReceiverClient, sessionClient tree.SessionIndexerClient) *Client

func (*Client) CreateNode

func (i *Client) CreateNode(ctx context.Context, node *tree.Node, updateIfExists bool) (err error)

func (*Client) DeleteNode

func (i *Client) DeleteNode(ctx context.Context, path string) (err error)

func (*Client) FinishSession

func (i *Client) FinishSession(ctx context.Context, sessionUuid string) error

func (*Client) FlushSession

func (i *Client) FlushSession(ctx context.Context, sessionUuid string) error

func (*Client) GetCachedBranches

func (i *Client) GetCachedBranches(ctx context.Context, roots ...string) model.PathSyncSource

GetCachedBranches implements CachedBranchProvider by loading branches in a MemDB

func (*Client) GetEndpointInfo

func (i *Client) GetEndpointInfo() model.EndpointInfo

func (*Client) LoadNode

func (i *Client) LoadNode(ctx context.Context, path string, extendedStats ...bool) (node *tree.Node, err error)

func (*Client) LoadNodeByUuid

func (i *Client) LoadNodeByUuid(ctx context.Context, uuid string) (node *tree.Node, err error)

LoadNodeByUuid makes this endpoint an UuidProvider

func (*Client) LockBranch

func (i *Client) LockBranch(ctx context.Context, node *tree.Node, sessionUUID string, expireAfter time.Duration) error

func (*Client) MoveNode

func (i *Client) MoveNode(ctx context.Context, oldPath string, newPath string) (err error)

func (*Client) StartSession

func (i *Client) StartSession(ctx context.Context, rootNode *tree.Node, silent bool) (*tree.IndexationSession, error)

func (*Client) UnlockBranch

func (i *Client) UnlockBranch(ctx context.Context, sessionUUID string) error

func (*Client) Walk

func (i *Client) Walk(walknFc model.WalkNodesFunc, root string, recursive bool) (err error)

func (*Client) Watch

func (i *Client) Watch(_ string) (*model.WatchObject, error)

type ClientWithMeta

type ClientWithMeta struct {
	Client
	// contains filtered or unexported fields
}

ClientWithMeta is a wrapper for index client that implements the MetadataReceiver interface

func NewClientWithMeta

func NewClientWithMeta(dsName string, reader tree.NodeProviderClient, writer tree.NodeReceiverClient, sessionClient tree.SessionIndexerClient) *ClientWithMeta

NewClientWithMeta creates a new client supporting metadata load

func (*ClientWithMeta) CreateMetadata

func (m *ClientWithMeta) CreateMetadata(ctx context.Context, node *tree.Node, namespace string, jsonValue string) error

CreateMetadata calls metaClient.CreateNode

func (*ClientWithMeta) DeleteMetadata

func (m *ClientWithMeta) DeleteMetadata(ctx context.Context, node *tree.Node, namespace string) error

DeleteMetadata calls metaClient.UpdateNode with the given namespace and an empty value (not DeleteNode, as it would remove all meta at once)

func (*ClientWithMeta) UpdateMetadata

func (m *ClientWithMeta) UpdateMetadata(ctx context.Context, node *tree.Node, namespace string, jsonValue string) error

UpdateMetadata calls metaClient.UpdateNode

func (*ClientWithMeta) Walk

func (m *ClientWithMeta) Walk(walknFc model.WalkNodesFunc, root string, recursive bool) (err error)

Walk wraps the initial Walk function to load metadata on the fly

type Streamer

type Streamer struct {
	// contains filtered or unexported fields
}

func NewStreamer

func NewStreamer(serviceName string) *Streamer

func (*Streamer) CreateNode

func (i *Streamer) CreateNode(ctx context.Context, request *tree.CreateNodeRequest) (response *tree.CreateNodeResponse, err error)

func (*Streamer) DeleteNode

func (i *Streamer) DeleteNode(ctx context.Context, request *tree.DeleteNodeRequest) (response *tree.DeleteNodeResponse, err error)

func (*Streamer) ReadNode

func (i *Streamer) ReadNode(ctx context.Context, request *tree.ReadNodeRequest) (response *tree.ReadNodeResponse, err error)

func (*Streamer) StartCreator

func (i *Streamer) StartCreator(ctx context.Context) error

func (*Streamer) StartDeleter

func (i *Streamer) StartDeleter(ctx context.Context) error

func (*Streamer) StartReader

func (i *Streamer) StartReader(ctx context.Context) error

func (*Streamer) StartUpdater

func (i *Streamer) StartUpdater(ctx context.Context) error

func (*Streamer) Stop

func (i *Streamer) Stop()

func (*Streamer) UpdateNode

func (i *Streamer) UpdateNode(ctx context.Context, request *tree.UpdateNodeRequest) (response *tree.UpdateNodeResponse, err error)

Jump to

Keyboard shortcuts

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