Documentation ¶
Overview ¶
Package grpc provides a GRPC service for aggregating all indexes from all datasources
Index ¶
- Variables
- type DataSource
- type EventSubscriber
- type StreamConverter
- func (sc *StreamConverter) Context() context.Context
- func (sc *StreamConverter) RecvMsg(i interface{}) error
- func (sc *StreamConverter) Send(response *tree.ListNodesResponse) error
- func (sc *StreamConverter) SendHeader(md metadata.MD) error
- func (sc *StreamConverter) SendMsg(i interface{}) error
- func (sc *StreamConverter) SetHeader(md metadata.MD) error
- func (sc *StreamConverter) SetTrailer(md metadata.MD)
- type TreeServer
- func (s *TreeServer) CreateNode(ctx context.Context, req *tree.CreateNodeRequest) (*tree.CreateNodeResponse, error)
- func (s *TreeServer) DeleteNode(ctx context.Context, req *tree.DeleteNodeRequest) (*tree.DeleteNodeResponse, error)
- func (s *TreeServer) ListNodes(req *tree.ListNodesRequest, resp tree.NodeProvider_ListNodesServer) error
- func (s *TreeServer) ListNodesWithLimit(ctx context.Context, metaStreamer meta.Loader, req *tree.ListNodesRequest, ...) error
- func (s *TreeServer) Name() string
- func (s *TreeServer) PublishChange(change *tree.NodeChangeEvent)
- func (s *TreeServer) ReadNode(ctx context.Context, req *tree.ReadNodeRequest) (*tree.ReadNodeResponse, error)
- func (s *TreeServer) ReadNodeStream(streamer tree.NodeProviderStreamer_ReadNodeStreamServer) error
- func (s *TreeServer) Search(request *tree.SearchRequest, stream tree.Searcher_SearchServer) error
- func (s *TreeServer) StreamChanges(req *tree.StreamChangesRequest, ...) error
- func (s *TreeServer) UpdateNode(ctx context.Context, req *tree.UpdateNodeRequest) (*tree.UpdateNodeResponse, error)
Constants ¶
This section is empty.
Variables ¶
var ServiceName = common.ServiceGrpcNamespace_ + common.ServiceTree
var (
UnitTests = false
)
Functions ¶
This section is empty.
Types ¶
type DataSource ¶
type DataSource struct { Name string // contains filtered or unexported fields }
func NewDataSource ¶
func NewDataSource(name string, reader tree.NodeProviderClient, writer tree.NodeReceiverClient) DataSource
type EventSubscriber ¶
type EventSubscriber struct { TreeServer *TreeServer // contains filtered or unexported fields }
func NewEventSubscriber ¶
func NewEventSubscriber(t *TreeServer) (*EventSubscriber, error)
func (*EventSubscriber) Handle ¶
func (s *EventSubscriber) Handle(ctx context.Context, msg *tree.NodeChangeEvent) error
Handle incoming INDEX events and resend them as TREE events. Events that carry an XPydioMoveUuid metadata are enqueued in a cache to re-create CREATE+DELETE pairs across datasources.
type StreamConverter ¶
type StreamConverter struct {
// contains filtered or unexported fields
}
StreamConverter wraps a Searcher_SearchStream into a NodesProvider_ListNodesStream
func (*StreamConverter) Context ¶
func (sc *StreamConverter) Context() context.Context
func (*StreamConverter) RecvMsg ¶
func (sc *StreamConverter) RecvMsg(i interface{}) error
func (*StreamConverter) Send ¶
func (sc *StreamConverter) Send(response *tree.ListNodesResponse) error
func (*StreamConverter) SendHeader ¶
func (sc *StreamConverter) SendHeader(md metadata.MD) error
func (*StreamConverter) SendMsg ¶
func (sc *StreamConverter) SendMsg(i interface{}) error
func (*StreamConverter) SetTrailer ¶
func (sc *StreamConverter) SetTrailer(md metadata.MD)
type TreeServer ¶
type TreeServer struct { tree.UnimplementedSearcherServer tree.UnimplementedNodeReceiverServer tree.UnimplementedNodeProviderServer tree.UnimplementedNodeProviderStreamerServer tree.UnimplementedNodeChangesStreamerServer sync.Mutex DataSources map[string]DataSource MainCtx context.Context // contains filtered or unexported fields }
func (*TreeServer) CreateNode ¶
func (s *TreeServer) CreateNode(ctx context.Context, req *tree.CreateNodeRequest) (*tree.CreateNodeResponse, error)
CreateNode implementation for the TreeServer
func (*TreeServer) DeleteNode ¶
func (s *TreeServer) DeleteNode(ctx context.Context, req *tree.DeleteNodeRequest) (*tree.DeleteNodeResponse, error)
DeleteNode implementation for the TreeServer
func (*TreeServer) ListNodes ¶
func (s *TreeServer) ListNodes(req *tree.ListNodesRequest, resp tree.NodeProvider_ListNodesServer) error
func (*TreeServer) ListNodesWithLimit ¶
func (s *TreeServer) ListNodesWithLimit(ctx context.Context, metaStreamer meta.Loader, req *tree.ListNodesRequest, resp tree.NodeProvider_ListNodesServer, cursorIndex *int64, numberSent *int64) error
ListNodesWithLimit implementation for the TreeServer
func (*TreeServer) Name ¶
func (s *TreeServer) Name() string
func (*TreeServer) PublishChange ¶
func (s *TreeServer) PublishChange(change *tree.NodeChangeEvent)
func (*TreeServer) ReadNode ¶
func (s *TreeServer) ReadNode(ctx context.Context, req *tree.ReadNodeRequest) (*tree.ReadNodeResponse, error)
ReadNode implementation for the TreeServer
func (*TreeServer) ReadNodeStream ¶
func (s *TreeServer) ReadNodeStream(streamer tree.NodeProviderStreamer_ReadNodeStreamServer) error
ReadNodeStream Implement stream for readNode method
func (*TreeServer) Search ¶
func (s *TreeServer) Search(request *tree.SearchRequest, stream tree.Searcher_SearchServer) error
Search implements the SearchServer handler method. It will transform a tree.SearchRequest into an underlying ListNode query
func (*TreeServer) StreamChanges ¶
func (s *TreeServer) StreamChanges(req *tree.StreamChangesRequest, streamer tree.NodeChangesStreamer_StreamChangesServer) error
func (*TreeServer) UpdateNode ¶
func (s *TreeServer) UpdateNode(ctx context.Context, req *tree.UpdateNodeRequest) (*tree.UpdateNodeResponse, error)
UpdateNode implementation for the TreeServer