Documentation ¶
Overview ¶
Package api is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterQueryServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterQueryServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryServiceClient) error
- func RegisterQueryServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterQueryServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServiceServer) error
- func RegisterQueryServiceServer(s *grpc.Server, srv QueryServiceServer)
- type DocType
- type GetSystemInfoRequest
- type GetSystemInfoResponse
- func (*GetSystemInfoResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetSystemInfoResponse) GetDocument() uint64
- func (x *GetSystemInfoResponse) GetDocumentCapacity() uint64
- func (x *GetSystemInfoResponse) GetServiceStatus() ServiceStatus
- func (x *GetSystemInfoResponse) GetVocabulary() uint64
- func (x *GetSystemInfoResponse) GetVocabularyCapacity() uint64
- func (*GetSystemInfoResponse) ProtoMessage()
- func (x *GetSystemInfoResponse) ProtoReflect() protoreflect.Message
- func (x *GetSystemInfoResponse) Reset()
- func (x *GetSystemInfoResponse) String() string
- type Packet
- func (*Packet) Descriptor() ([]byte, []int)deprecated
- func (x *Packet) GetDeliveryStatus() PacketDeliveryStatus
- func (x *Packet) GetDocId() string
- func (x *Packet) GetDocTitle() string
- func (x *Packet) GetDocType() DocType
- func (x *Packet) GetWebStation() WebStation
- func (*Packet) ProtoMessage()
- func (x *Packet) ProtoReflect() protoreflect.Message
- func (x *Packet) Reset()
- func (x *Packet) String() string
- type PacketDeliveryStatus
- func (PacketDeliveryStatus) Descriptor() protoreflect.EnumDescriptor
- func (x PacketDeliveryStatus) Enum() *PacketDeliveryStatus
- func (PacketDeliveryStatus) EnumDescriptor() ([]byte, []int)deprecated
- func (x PacketDeliveryStatus) Number() protoreflect.EnumNumber
- func (x PacketDeliveryStatus) String() string
- func (PacketDeliveryStatus) Type() protoreflect.EnumType
- type QueryRequest
- func (*QueryRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryRequest) GetQuery() string
- func (x *QueryRequest) GetTopk() uint32
- func (*QueryRequest) ProtoMessage()
- func (x *QueryRequest) ProtoReflect() protoreflect.Message
- func (x *QueryRequest) Reset()
- func (x *QueryRequest) String() string
- type QueryResponse
- type QueryServiceClient
- type QueryServiceServer
- type ServiceStatus
- func (ServiceStatus) Descriptor() protoreflect.EnumDescriptor
- func (x ServiceStatus) Enum() *ServiceStatus
- func (ServiceStatus) EnumDescriptor() ([]byte, []int)deprecated
- func (x ServiceStatus) Number() protoreflect.EnumNumber
- func (x ServiceStatus) String() string
- func (ServiceStatus) Type() protoreflect.EnumType
- type UnimplementedQueryServiceServer
- type WebStation
Constants ¶
This section is empty.
Variables ¶
var ( WebStation_name = map[int32]string{ 0: "MOFRPC", } WebStation_value = map[string]int32{ "MOFRPC": 0, } )
Enum value maps for WebStation.
var ( DocType_name = map[int32]string{ 0: "HTMLDoc", 1: "TextDoc", } DocType_value = map[string]int32{ "HTMLDoc": 0, "TextDoc": 1, } )
Enum value maps for DocType.
var ( PacketDeliveryStatus_name = map[int32]string{ 0: "InDelivery", 1: "OutOfStock", } PacketDeliveryStatus_value = map[string]int32{ "InDelivery": 0, "OutOfStock": 1, } )
Enum value maps for PacketDeliveryStatus.
var ( ServiceStatus_name = map[int32]string{ 0: "Unavailable", 1: "Available", } ServiceStatus_value = map[string]int32{ "Unavailable": 0, "Available": 1, } )
Enum value maps for ServiceStatus.
var File_github_com_amazingchow_photon_dance_vector_space_searcher_pb_photon_dance_vector_space_searcher_proto protoreflect.FileDescriptor
Functions ¶
func RegisterQueryServiceHandler ¶
func RegisterQueryServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterQueryServiceHandler registers the http handlers for service QueryService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterQueryServiceHandlerClient ¶
func RegisterQueryServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryServiceClient) error
RegisterQueryServiceHandlerClient registers the http handlers for service QueryService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryServiceClient" to call the correct interceptors.
func RegisterQueryServiceHandlerFromEndpoint ¶
func RegisterQueryServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterQueryServiceHandlerFromEndpoint is same as RegisterQueryServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterQueryServiceHandlerServer ¶
func RegisterQueryServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServiceServer) error
RegisterQueryServiceHandlerServer registers the http handlers for service QueryService to "mux". UnaryRPC :call QueryServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
func RegisterQueryServiceServer ¶
func RegisterQueryServiceServer(s *grpc.Server, srv QueryServiceServer)
Types ¶
type DocType ¶
type DocType int32
func (DocType) Descriptor ¶
func (DocType) Descriptor() protoreflect.EnumDescriptor
func (DocType) EnumDescriptor
deprecated
func (DocType) Number ¶
func (x DocType) Number() protoreflect.EnumNumber
func (DocType) Type ¶
func (DocType) Type() protoreflect.EnumType
type GetSystemInfoRequest ¶
type GetSystemInfoRequest struct {
// contains filtered or unexported fields
}
func (*GetSystemInfoRequest) Descriptor
deprecated
func (*GetSystemInfoRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetSystemInfoRequest.ProtoReflect.Descriptor instead.
func (*GetSystemInfoRequest) ProtoMessage ¶
func (*GetSystemInfoRequest) ProtoMessage()
func (*GetSystemInfoRequest) ProtoReflect ¶
func (x *GetSystemInfoRequest) ProtoReflect() protoreflect.Message
func (*GetSystemInfoRequest) Reset ¶
func (x *GetSystemInfoRequest) Reset()
func (*GetSystemInfoRequest) String ¶
func (x *GetSystemInfoRequest) String() string
type GetSystemInfoResponse ¶
type GetSystemInfoResponse struct { DocumentCapacity uint64 `protobuf:"varint,1,opt,name=document_capacity,json=documentCapacity,proto3" json:"document_capacity,omitempty"` Document uint64 `protobuf:"varint,2,opt,name=document,proto3" json:"document,omitempty"` VocabularyCapacity uint64 `protobuf:"varint,3,opt,name=vocabulary_capacity,json=vocabularyCapacity,proto3" json:"vocabulary_capacity,omitempty"` Vocabulary uint64 `protobuf:"varint,4,opt,name=vocabulary,proto3" json:"vocabulary,omitempty"` ServiceStatus ServiceStatus `` /* 167-byte string literal not displayed */ // contains filtered or unexported fields }
func (*GetSystemInfoResponse) Descriptor
deprecated
func (*GetSystemInfoResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetSystemInfoResponse.ProtoReflect.Descriptor instead.
func (*GetSystemInfoResponse) GetDocument ¶
func (x *GetSystemInfoResponse) GetDocument() uint64
func (*GetSystemInfoResponse) GetDocumentCapacity ¶
func (x *GetSystemInfoResponse) GetDocumentCapacity() uint64
func (*GetSystemInfoResponse) GetServiceStatus ¶
func (x *GetSystemInfoResponse) GetServiceStatus() ServiceStatus
func (*GetSystemInfoResponse) GetVocabulary ¶
func (x *GetSystemInfoResponse) GetVocabulary() uint64
func (*GetSystemInfoResponse) GetVocabularyCapacity ¶
func (x *GetSystemInfoResponse) GetVocabularyCapacity() uint64
func (*GetSystemInfoResponse) ProtoMessage ¶
func (*GetSystemInfoResponse) ProtoMessage()
func (*GetSystemInfoResponse) ProtoReflect ¶
func (x *GetSystemInfoResponse) ProtoReflect() protoreflect.Message
func (*GetSystemInfoResponse) Reset ¶
func (x *GetSystemInfoResponse) Reset()
func (*GetSystemInfoResponse) String ¶
func (x *GetSystemInfoResponse) String() string
type Packet ¶
type Packet struct { WebStation WebStation `` /* 155-byte string literal not displayed */ DocType DocType `` /* 143-byte string literal not displayed */ DocId string `protobuf:"bytes,3,opt,name=doc_id,json=docId,proto3" json:"doc_id,omitempty"` DocTitle string `protobuf:"bytes,4,opt,name=doc_title,json=docTitle,proto3" json:"doc_title,omitempty"` DeliveryStatus PacketDeliveryStatus `` /* 177-byte string literal not displayed */ // contains filtered or unexported fields }
传输数据包.
func (*Packet) Descriptor
deprecated
func (*Packet) GetDeliveryStatus ¶
func (x *Packet) GetDeliveryStatus() PacketDeliveryStatus
func (*Packet) GetDocTitle ¶
func (*Packet) GetDocType ¶
func (*Packet) GetWebStation ¶
func (x *Packet) GetWebStation() WebStation
func (*Packet) ProtoMessage ¶
func (*Packet) ProtoMessage()
func (*Packet) ProtoReflect ¶
func (x *Packet) ProtoReflect() protoreflect.Message
type PacketDeliveryStatus ¶
type PacketDeliveryStatus int32
const ( // 数据包派送中 PacketDeliveryStatus_InDelivery PacketDeliveryStatus = 0 // 数据包派送完毕或无数据可供派送 PacketDeliveryStatus_OutOfStock PacketDeliveryStatus = 1 )
func (PacketDeliveryStatus) Descriptor ¶
func (PacketDeliveryStatus) Descriptor() protoreflect.EnumDescriptor
func (PacketDeliveryStatus) Enum ¶
func (x PacketDeliveryStatus) Enum() *PacketDeliveryStatus
func (PacketDeliveryStatus) EnumDescriptor
deprecated
func (PacketDeliveryStatus) EnumDescriptor() ([]byte, []int)
Deprecated: Use PacketDeliveryStatus.Descriptor instead.
func (PacketDeliveryStatus) Number ¶
func (x PacketDeliveryStatus) Number() protoreflect.EnumNumber
func (PacketDeliveryStatus) String ¶
func (x PacketDeliveryStatus) String() string
func (PacketDeliveryStatus) Type ¶
func (PacketDeliveryStatus) Type() protoreflect.EnumType
type QueryRequest ¶
type QueryRequest struct { Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` Topk uint32 `protobuf:"varint,2,opt,name=topk,proto3" json:"topk,omitempty"` // contains filtered or unexported fields }
-------------------- request & response --------------------
func (*QueryRequest) Descriptor
deprecated
func (*QueryRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead.
func (*QueryRequest) GetQuery ¶
func (x *QueryRequest) GetQuery() string
func (*QueryRequest) GetTopk ¶
func (x *QueryRequest) GetTopk() uint32
func (*QueryRequest) ProtoMessage ¶
func (*QueryRequest) ProtoMessage()
func (*QueryRequest) ProtoReflect ¶
func (x *QueryRequest) ProtoReflect() protoreflect.Message
func (*QueryRequest) Reset ¶
func (x *QueryRequest) Reset()
func (*QueryRequest) String ¶
func (x *QueryRequest) String() string
type QueryResponse ¶
type QueryResponse struct { Docs []string `protobuf:"bytes,1,rep,name=docs,proto3" json:"docs,omitempty"` // contains filtered or unexported fields }
func (*QueryResponse) Descriptor
deprecated
func (*QueryResponse) Descriptor() ([]byte, []int)
Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead.
func (*QueryResponse) GetDocs ¶
func (x *QueryResponse) GetDocs() []string
func (*QueryResponse) ProtoMessage ¶
func (*QueryResponse) ProtoMessage()
func (*QueryResponse) ProtoReflect ¶
func (x *QueryResponse) ProtoReflect() protoreflect.Message
func (*QueryResponse) Reset ¶
func (x *QueryResponse) Reset()
func (*QueryResponse) String ¶
func (x *QueryResponse) String() string
type QueryServiceClient ¶
type QueryServiceClient interface { Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) GetSystemInfo(ctx context.Context, in *GetSystemInfoRequest, opts ...grpc.CallOption) (*GetSystemInfoResponse, error) }
QueryServiceClient is the client API for QueryService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewQueryServiceClient ¶
func NewQueryServiceClient(cc grpc.ClientConnInterface) QueryServiceClient
type QueryServiceServer ¶
type QueryServiceServer interface { Query(context.Context, *QueryRequest) (*QueryResponse, error) GetSystemInfo(context.Context, *GetSystemInfoRequest) (*GetSystemInfoResponse, error) }
QueryServiceServer is the server API for QueryService service.
type ServiceStatus ¶
type ServiceStatus int32
const ( ServiceStatus_Available ServiceStatus = 1 )
func (ServiceStatus) Descriptor ¶
func (ServiceStatus) Descriptor() protoreflect.EnumDescriptor
func (ServiceStatus) Enum ¶
func (x ServiceStatus) Enum() *ServiceStatus
func (ServiceStatus) EnumDescriptor
deprecated
func (ServiceStatus) EnumDescriptor() ([]byte, []int)
Deprecated: Use ServiceStatus.Descriptor instead.
func (ServiceStatus) Number ¶
func (x ServiceStatus) Number() protoreflect.EnumNumber
func (ServiceStatus) String ¶
func (x ServiceStatus) String() string
func (ServiceStatus) Type ¶
func (ServiceStatus) Type() protoreflect.EnumType
type UnimplementedQueryServiceServer ¶
type UnimplementedQueryServiceServer struct { }
UnimplementedQueryServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedQueryServiceServer) GetSystemInfo ¶
func (*UnimplementedQueryServiceServer) GetSystemInfo(context.Context, *GetSystemInfoRequest) (*GetSystemInfoResponse, error)
func (*UnimplementedQueryServiceServer) Query ¶
func (*UnimplementedQueryServiceServer) Query(context.Context, *QueryRequest) (*QueryResponse, error)
type WebStation ¶
type WebStation int32
const ( // 中华人民共和国财政部网站 WebStation_MOFRPC WebStation = 0 )
func (WebStation) Descriptor ¶
func (WebStation) Descriptor() protoreflect.EnumDescriptor
func (WebStation) Enum ¶
func (x WebStation) Enum() *WebStation
func (WebStation) EnumDescriptor
deprecated
func (WebStation) EnumDescriptor() ([]byte, []int)
Deprecated: Use WebStation.Descriptor instead.
func (WebStation) Number ¶
func (x WebStation) Number() protoreflect.EnumNumber
func (WebStation) String ¶
func (x WebStation) String() string
func (WebStation) Type ¶
func (WebStation) Type() protoreflect.EnumType