server

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	api.UnimplementedGoodmatchServer
	// contains filtered or unexported fields
}

Server implements the HTTP and gRPC server.

func New

func New(conf config.Server, c *core.Core) *Server

New creates a new Server.

func (*Server) Classify

func (s *Server) Classify(
	ctx context.Context,
	req *api.ClassifyRequest,
) (*api.ClassifyResponse, error)

Classify performs a normal documents search and uses the document tags from the results to classify the input text.

func (*Server) Consolidate

func (s *Server) Consolidate(
	ctx context.Context,
	req *api.ConsolidateRequest,
) (*api.ConsolidateResponse, error)

Consolidate builds the internal searchable index for Documents in a Namespace.

func (*Server) CreateNamespace

func (s *Server) CreateNamespace(
	ctx context.Context,
	req *api.CreateNamespaceRequest,
) (*api.CreateNamespaceResponse, error)

CreateNamespace creates a new Namespace.

func (*Server) DeleteDocument

func (s *Server) DeleteDocument(
	ctx context.Context,
	req *api.DeleteDocumentRequest,
) (*api.DeleteDocumentResponse, error)

DeleteDocument deletes a Document given its ID and Namespace.

func (*Server) DeleteNamespace

func (s *Server) DeleteNamespace(
	ctx context.Context,
	req *api.DeleteNamespaceRequest,
) (*api.DeleteNamespaceResponse, error)

DeleteNamespace deletes a Namespace and all its Documents.

func (*Server) GetDocument

func (s *Server) GetDocument(
	ctx context.Context,
	req *api.GetDocumentRequest,
) (*api.GetDocumentResponse, error)

GetDocument returns a Document given its ID and Namespace.

func (*Server) GetDocuments

func (s *Server) GetDocuments(
	ctx context.Context,
	req *api.GetDocumentsRequest,
) (*api.GetDocumentsResponse, error)

GetDocuments returns all Documents from a Namespace.

func (*Server) GetNamespaces

func (s *Server) GetNamespaces(
	ctx context.Context,
	req *emptypb.Empty,
) (*api.GetNamespacesResponse, error)

GetNamespaces returns the list of all Namespaces.

func (*Server) InsertDocuments

func (s *Server) InsertDocuments(
	ctx context.Context,
	req *api.InsertDocumentsRequest,
) (*api.InsertDocumentsResponse, error)

InsertDocuments inserts new Documents.

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Run runs the server according to its configuration.

func (*Server) SearchDocuments

func (s *Server) SearchDocuments(
	ctx context.Context,
	req *api.SearchDocumentsRequest,
) (*api.SearchDocumentsResponse, error)

SearchDocuments performs a semantic search over all documents from a Namespace.

Directories

Path Synopsis
Package api is a reverse proxy.
Package api is a reverse proxy.

Jump to

Keyboard shortcuts

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