omniscience

package
v0.0.0-...-ae29d40 Latest Latest
Warning

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

Go to latest
Published: May 29, 2018 License: MIT Imports: 15 Imported by: 8

Documentation

Overview

Package omniscience is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterIngesterServer

func RegisterIngesterServer(s *grpc.Server, srv IngesterServer)

func RegisterSearchHandler

func RegisterSearchHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterSearchHandler registers the http handlers for service Search to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterSearchHandlerClient

func RegisterSearchHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SearchClient) error

RegisterSearchHandler registers the http handlers for service Search to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SearchClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SearchClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SearchClient" to call the correct interceptors.

func RegisterSearchHandlerFromEndpoint

func RegisterSearchHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterSearchHandlerFromEndpoint is same as RegisterSearchHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterSearchServer

func RegisterSearchServer(s *grpc.Server, srv SearchServer)

Types

type Document

type Document struct {
	Id                   *DocumentId          `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	Title                string               `protobuf:"bytes,2,opt,name=title" json:"title,omitempty"`
	Description          string               `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"`
	Content              string               `protobuf:"bytes,4,opt,name=content" json:"content,omitempty"`
	Url                  string               `protobuf:"bytes,5,opt,name=url" json:"url,omitempty"`
	Service              string               `protobuf:"bytes,6,opt,name=service" json:"service,omitempty"`
	LastModified         *timestamp.Timestamp `protobuf:"bytes,7,opt,name=last_modified,json=lastModified" json:"last_modified,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

func (*Document) Descriptor

func (*Document) Descriptor() ([]byte, []int)

func (*Document) GetContent

func (m *Document) GetContent() string

func (*Document) GetDescription

func (m *Document) GetDescription() string

func (*Document) GetId

func (m *Document) GetId() *DocumentId

func (*Document) GetLastModified

func (m *Document) GetLastModified() *timestamp.Timestamp

func (*Document) GetService

func (m *Document) GetService() string

func (*Document) GetTitle

func (m *Document) GetTitle() string

func (*Document) GetUrl

func (m *Document) GetUrl() string

func (*Document) ProtoMessage

func (*Document) ProtoMessage()

func (*Document) Reset

func (m *Document) Reset()

func (*Document) String

func (m *Document) String() string

func (*Document) XXX_DiscardUnknown

func (m *Document) XXX_DiscardUnknown()

func (*Document) XXX_Marshal

func (m *Document) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Document) XXX_Merge

func (dst *Document) XXX_Merge(src proto.Message)

func (*Document) XXX_Size

func (m *Document) XXX_Size() int

func (*Document) XXX_Unmarshal

func (m *Document) XXX_Unmarshal(b []byte) error

type DocumentId

type DocumentId struct {
	Id                   string   `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*DocumentId) Descriptor

func (*DocumentId) Descriptor() ([]byte, []int)

func (*DocumentId) GetId

func (m *DocumentId) GetId() string

func (*DocumentId) ProtoMessage

func (*DocumentId) ProtoMessage()

func (*DocumentId) Reset

func (m *DocumentId) Reset()

func (*DocumentId) String

func (m *DocumentId) String() string

func (*DocumentId) XXX_DiscardUnknown

func (m *DocumentId) XXX_DiscardUnknown()

func (*DocumentId) XXX_Marshal

func (m *DocumentId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DocumentId) XXX_Merge

func (dst *DocumentId) XXX_Merge(src proto.Message)

func (*DocumentId) XXX_Size

func (m *DocumentId) XXX_Size() int

func (*DocumentId) XXX_Unmarshal

func (m *DocumentId) XXX_Unmarshal(b []byte) error

type IngesterClient

type IngesterClient interface {
	// Ingests documents and indexes and uploads them to persistant storage.
	Ingest(ctx context.Context, opts ...grpc.CallOption) (Ingester_IngestClient, error)
}

IngesterClient is the client API for Ingester service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewIngesterClient

func NewIngesterClient(cc *grpc.ClientConn) IngesterClient

type IngesterServer

type IngesterServer interface {
	// Ingests documents and indexes and uploads them to persistant storage.
	Ingest(Ingester_IngestServer) error
}

IngesterServer is the server API for Ingester service.

type Ingester_IngestClient

type Ingester_IngestClient interface {
	Send(*Document) error
	CloseAndRecv() (*empty.Empty, error)
	grpc.ClientStream
}

type Ingester_IngestServer

type Ingester_IngestServer interface {
	SendAndClose(*empty.Empty) error
	Recv() (*Document, error)
	grpc.ServerStream
}

type ListServicesRequest

type ListServicesRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ListServicesRequest) Descriptor

func (*ListServicesRequest) Descriptor() ([]byte, []int)

func (*ListServicesRequest) ProtoMessage

func (*ListServicesRequest) ProtoMessage()

func (*ListServicesRequest) Reset

func (m *ListServicesRequest) Reset()

func (*ListServicesRequest) String

func (m *ListServicesRequest) String() string

func (*ListServicesRequest) XXX_DiscardUnknown

func (m *ListServicesRequest) XXX_DiscardUnknown()

func (*ListServicesRequest) XXX_Marshal

func (m *ListServicesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ListServicesRequest) XXX_Merge

func (dst *ListServicesRequest) XXX_Merge(src proto.Message)

func (*ListServicesRequest) XXX_Size

func (m *ListServicesRequest) XXX_Size() int

func (*ListServicesRequest) XXX_Unmarshal

func (m *ListServicesRequest) XXX_Unmarshal(b []byte) error

type ListServicesResponse

type ListServicesResponse struct {
	Services             []*Service `protobuf:"bytes,1,rep,name=services" json:"services,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

func (*ListServicesResponse) Descriptor

func (*ListServicesResponse) Descriptor() ([]byte, []int)

func (*ListServicesResponse) GetServices

func (m *ListServicesResponse) GetServices() []*Service

func (*ListServicesResponse) ProtoMessage

func (*ListServicesResponse) ProtoMessage()

func (*ListServicesResponse) Reset

func (m *ListServicesResponse) Reset()

func (*ListServicesResponse) String

func (m *ListServicesResponse) String() string

func (*ListServicesResponse) XXX_DiscardUnknown

func (m *ListServicesResponse) XXX_DiscardUnknown()

func (*ListServicesResponse) XXX_Marshal

func (m *ListServicesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ListServicesResponse) XXX_Merge

func (dst *ListServicesResponse) XXX_Merge(src proto.Message)

func (*ListServicesResponse) XXX_Size

func (m *ListServicesResponse) XXX_Size() int

func (*ListServicesResponse) XXX_Unmarshal

func (m *ListServicesResponse) XXX_Unmarshal(b []byte) error

type SearchClient

type SearchClient interface {
	// List all services which have documents available for searching.
	ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error)
}

SearchClient is the client API for Search service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewSearchClient

func NewSearchClient(cc *grpc.ClientConn) SearchClient

type SearchServer

type SearchServer interface {
	// List all services which have documents available for searching.
	ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error)
}

SearchServer is the server API for Search service.

type Service

type Service struct {
	Id                   string   `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Service) Descriptor

func (*Service) Descriptor() ([]byte, []int)

func (*Service) GetId

func (m *Service) GetId() string

func (*Service) ProtoMessage

func (*Service) ProtoMessage()

func (*Service) Reset

func (m *Service) Reset()

func (*Service) String

func (m *Service) String() string

func (*Service) XXX_DiscardUnknown

func (m *Service) XXX_DiscardUnknown()

func (*Service) XXX_Marshal

func (m *Service) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Service) XXX_Merge

func (dst *Service) XXX_Merge(src proto.Message)

func (*Service) XXX_Size

func (m *Service) XXX_Size() int

func (*Service) XXX_Unmarshal

func (m *Service) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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