suggest

package
v0.7.3-0...-afa7ed7 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package suggest is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use ListReq.ProtoReflect.Descriptor instead.

func (*ListReq) GetType

func (x *ListReq) GetType() string

func (*ListReq) GetValue

func (x *ListReq) GetValue() string

func (*ListReq) ProtoMessage

func (*ListReq) ProtoMessage()

func (*ListReq) ProtoReflect

func (x *ListReq) ProtoReflect() protoreflect.Message

func (*ListReq) Reset

func (x *ListReq) Reset()

func (*ListReq) String

func (x *ListReq) String() string

func (*ListReq) Validate

func (m *ListReq) Validate() error

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) Descriptor() ([]byte, []int)

Deprecated: Use ListResp.ProtoReflect.Descriptor instead.

func (*ListResp) GetData

func (x *ListResp) GetData() []string

func (*ListResp) ProtoMessage

func (*ListResp) ProtoMessage()

func (*ListResp) ProtoReflect

func (x *ListResp) ProtoReflect() protoreflect.Message

func (*ListResp) Reset

func (x *ListResp) Reset()

func (*ListResp) String

func (x *ListResp) String() string

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.

func (UnimplementedSuggestServer) List

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.

Jump to

Keyboard shortcuts

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