Documentation ¶
Overview ¶
Package suggest is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func NewSuggestServiceDesc(i SuggestServer) transport.ServiceDesc
- func RegisterSuggestHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterSuggestHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SuggestClient) error
- func RegisterSuggestHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterSuggestHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SuggestServer) error
- func RegisterSuggestServer(s *grpc.Server, srv SuggestServer)
- type ListReq
- func (*ListReq) Descriptor() ([]byte, []int)deprecated
- func (x *ListReq) GetType() string
- func (x *ListReq) GetValue() string
- func (*ListReq) ProtoMessage()
- func (x *ListReq) ProtoReflect() protoreflect.Message
- func (x *ListReq) Reset()
- func (x *ListReq) String() string
- func (m *ListReq) Validate() error
- type ListResp
- type SuggestClient
- type SuggestServer
- type SuggestServiceDesc
- type UnimplementedSuggestServer
- type UnsafeSuggestServer
Constants ¶
This section is empty.
Variables ¶
var File_suggest_proto protoreflect.FileDescriptor
Functions ¶
func NewSuggestServiceDesc ¶
func NewSuggestServiceDesc(i SuggestServer) transport.ServiceDesc
func RegisterSuggestHandler ¶
func RegisterSuggestHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterSuggestHandler registers the http handlers for service Suggest to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterSuggestHandlerClient ¶
func RegisterSuggestHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SuggestClient) error
RegisterSuggestHandlerClient registers the http handlers for service Suggest to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SuggestClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SuggestClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SuggestClient" to call the correct interceptors.
func RegisterSuggestHandlerFromEndpoint ¶
func RegisterSuggestHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterSuggestHandlerFromEndpoint is same as RegisterSuggestHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterSuggestHandlerServer ¶
func RegisterSuggestHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SuggestServer) error
RegisterSuggestHandlerServer registers the http handlers for service Suggest to "mux". UnaryRPC :call SuggestServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterSuggestHandlerFromEndpoint instead.
func RegisterSuggestServer ¶
func RegisterSuggestServer(s *grpc.Server, srv SuggestServer)
Types ¶
type ListReq ¶
type ListReq struct { Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*ListReq) Descriptor
deprecated
func (*ListReq) ProtoMessage ¶
func (*ListReq) ProtoMessage()
func (*ListReq) ProtoReflect ¶
func (x *ListReq) ProtoReflect() protoreflect.Message
type ListResp ¶
type ListResp struct { Data []string `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*ListResp) Descriptor
deprecated
func (*ListResp) ProtoMessage ¶
func (*ListResp) ProtoMessage()
func (*ListResp) ProtoReflect ¶
func (x *ListResp) ProtoReflect() protoreflect.Message
type SuggestClient ¶
type SuggestClient interface {
List(ctx context.Context, in *ListReq, opts ...grpc.CallOption) (*ListResp, error)
}
SuggestClient is the client API for Suggest service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewSuggestClient ¶
func NewSuggestClient(cc grpc.ClientConnInterface) SuggestClient
type SuggestServer ¶
type SuggestServer interface { List(context.Context, *ListReq) (*ListResp, error) // contains filtered or unexported methods }
SuggestServer is the server API for Suggest service. All implementations must embed UnimplementedSuggestServer for forward compatibility
type SuggestServiceDesc ¶
type SuggestServiceDesc struct {
// contains filtered or unexported fields
}
SuggestServiceDesc is description for the SuggestServer.
func (*SuggestServiceDesc) RegisterGRPC ¶
func (d *SuggestServiceDesc) RegisterGRPC(s *grpc.Server)
func (*SuggestServiceDesc) RegisterHTTP ¶
func (d *SuggestServiceDesc) RegisterHTTP(mux *runtime.ServeMux)
func (*SuggestServiceDesc) SwaggerDef ¶
func (d *SuggestServiceDesc) SwaggerDef() []byte
type UnimplementedSuggestServer ¶
type UnimplementedSuggestServer struct { }
UnimplementedSuggestServer must be embedded to have forward compatible implementations.
type UnsafeSuggestServer ¶
type UnsafeSuggestServer interface {
// contains filtered or unexported methods
}
UnsafeSuggestServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SuggestServer will result in compilation errors.