identifiers

package
v0.0.33 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: Apache-2.0, NCSA Imports: 9 Imported by: 3

Documentation

Overview

Package identifiers provides a high-performance table-based implementation of the identifiers.Service. The table is structured as:

qualifed_name -> IdentifierMatch

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHTTPHandlers

func RegisterHTTPHandlers(ctx context.Context, id Service, mux *http.ServeMux)

RegisterHTTPHandlers registers a JSON HTTP handler with mux using the given identifiers Service. The following method with be exposed:

GET /find_identifier
  Request: JSON encoded identifier.FindRequest
  Response: JSON encoded identifier.FindReply

Note: /find_identifier will return its response as a serialized protobuf if the "proto" query parameter is set.

Types

type Service

type Service interface {
	// Find returns an index of nodes associated with a given identifier
	Find(context.Context, *ipb.FindRequest) (*ipb.FindReply, error)
}

Service describes the interface for the identifier service which provides lookups from fully qualified identifiers to any matching semantic nodes

func WebClient

func WebClient(addr string) Service

WebClient returns an identifiers Service based on a remote web server.

type Table

type Table struct {
	table.Proto
}

Table wraps around a table.Proto to provide the Service interface

func (*Table) Find

func (it *Table) Find(ctx context.Context, req *ipb.FindRequest) (*ipb.FindReply, error)

Find implements the Service interface for Table

Jump to

Keyboard shortcuts

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