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 ¶
- type Client
- func (i *Client) CreateNode(ctx context.Context, node tree.N, updateIfExists bool) (err error)
- func (i *Client) DeleteNode(ctx context.Context, path string) (err error)
- func (i *Client) FinishSession(ctx context.Context, sessionUuid string) error
- func (i *Client) FlushSession(ctx context.Context, sessionUuid string) error
- func (i *Client) GetCachedBranches(ctx context.Context, roots ...string) (model.PathSyncSource, error)
- func (i *Client) GetEndpointInfo() model.EndpointInfo
- func (i *Client) LoadNode(ctx context.Context, path string, extendedStats ...bool) (node tree.N, err error)
- func (i *Client) LoadNodeByUuid(ctx context.Context, uuid string) (node tree.N, err error)
- func (i *Client) LockBranch(ctx context.Context, node tree.N, sessionUUID string, ...) error
- func (i *Client) MoveNode(ctx context.Context, oldPath string, newPath string) (err error)
- func (i *Client) StartSession(ctx context.Context, rootNode tree.N, silent bool) (string, error)
- func (i *Client) UnlockBranch(ctx context.Context, sessionUUID string) error
- func (i *Client) Walk(ctx context.Context, walknFc model.WalkNodesFunc, root string, recursive bool) (err error)
- func (i *Client) Watch(_ string) (*model.WatchObject, error)
- type ClientWithMeta
- func (m *ClientWithMeta) CreateMetadata(ctx context.Context, node tree.N, namespace string, jsonValue string) error
- func (m *ClientWithMeta) DeleteMetadata(ctx context.Context, node tree.N, namespace string) error
- func (m *ClientWithMeta) UpdateMetadata(ctx context.Context, node tree.N, namespace string, jsonValue string) error
- func (m *ClientWithMeta) Walk(ctx context.Context, walknFc model.WalkNodesFunc, root string, recursive bool) (err error)
- type Streamer
- func (i *Streamer) CreateNode(ctx context.Context, request *tree.CreateNodeRequest) (response *tree.CreateNodeResponse, err error)
- func (i *Streamer) DeleteNode(ctx context.Context, request *tree.DeleteNodeRequest) (response *tree.DeleteNodeResponse, err error)
- func (i *Streamer) ReadNode(ctx context.Context, request *tree.ReadNodeRequest) (response *tree.ReadNodeResponse, err error)
- func (i *Streamer) StartCreator(ctx context.Context) error
- func (i *Streamer) StartDeleter(ctx context.Context) error
- func (i *Streamer) StartReader(ctx context.Context) error
- func (i *Streamer) StartUpdater(ctx context.Context) error
- func (i *Streamer) Stop()
- func (i *Streamer) UpdateNode(ctx context.Context, request *tree.UpdateNodeRequest) (response *tree.UpdateNodeResponse, err error)
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 (*Client) DeleteNode ¶
func (*Client) FinishSession ¶
func (*Client) FlushSession ¶
func (*Client) GetCachedBranches ¶
func (i *Client) GetCachedBranches(ctx context.Context, roots ...string) (model.PathSyncSource, error)
GetCachedBranches implements CachedBranchProvider by loading branches in a MemDB
func (*Client) GetEndpointInfo ¶
func (i *Client) GetEndpointInfo() model.EndpointInfo
func (*Client) LoadNodeByUuid ¶
LoadNodeByUuid makes this endpoint an UuidProvider
func (*Client) LockBranch ¶
func (*Client) StartSession ¶
func (*Client) UnlockBranch ¶
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(ctx context.Context, 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.N, namespace string, jsonValue string) error
CreateMetadata calls metaClient.CreateNode
func (*ClientWithMeta) DeleteMetadata ¶
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.N, namespace string, jsonValue string) error
UpdateMetadata calls metaClient.UpdateNode
func (*ClientWithMeta) Walk ¶
func (m *ClientWithMeta) Walk(ctx context.Context, 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 (*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) UpdateNode ¶
func (i *Streamer) UpdateNode(ctx context.Context, request *tree.UpdateNodeRequest) (response *tree.UpdateNodeResponse, err error)