Documentation ¶
Overview ¶
Package hello is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterHelloHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterHelloHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HelloClient) error
- func RegisterHelloHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterHelloServer(s *grpc.Server, srv HelloServer)
- type HelloClient
- type HelloServer
- type NameRequest
- func (*NameRequest) Descriptor() ([]byte, []int)
- func (m *NameRequest) GetName() string
- func (*NameRequest) ProtoMessage()
- func (m *NameRequest) Reset()
- func (m *NameRequest) String() string
- func (m *NameRequest) XXX_DiscardUnknown()
- func (m *NameRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *NameRequest) XXX_Merge(src proto.Message)
- func (m *NameRequest) XXX_Size() int
- func (m *NameRequest) XXX_Unmarshal(b []byte) error
- type Response
- func (*Response) Descriptor() ([]byte, []int)
- func (m *Response) GetMessage() string
- func (*Response) ProtoMessage()
- func (m *Response) Reset()
- func (m *Response) String() string
- func (m *Response) XXX_DiscardUnknown()
- func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Response) XXX_Merge(src proto.Message)
- func (m *Response) XXX_Size() int
- func (m *Response) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterHelloHandler ¶
RegisterHelloHandler registers the http handlers for service Hello to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterHelloHandlerClient ¶
func RegisterHelloHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HelloClient) error
RegisterHelloHandlerClient registers the http handlers for service Hello to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "HelloClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "HelloClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "HelloClient" to call the correct interceptors.
func RegisterHelloHandlerFromEndpoint ¶
func RegisterHelloHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterHelloHandlerFromEndpoint is same as RegisterHelloHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterHelloServer ¶
func RegisterHelloServer(s *grpc.Server, srv HelloServer)
Types ¶
type HelloClient ¶
type HelloClient interface { Hello(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Response, error) HelloName(ctx context.Context, in *NameRequest, opts ...grpc.CallOption) (*Response, error) }
HelloClient is the client API for Hello service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewHelloClient ¶
func NewHelloClient(cc *grpc.ClientConn) HelloClient
type HelloServer ¶
type HelloServer interface { Hello(context.Context, *empty.Empty) (*Response, error) HelloName(context.Context, *NameRequest) (*Response, error) }
HelloServer is the server API for Hello service.
type NameRequest ¶
type NameRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*NameRequest) Descriptor ¶
func (*NameRequest) Descriptor() ([]byte, []int)
func (*NameRequest) GetName ¶
func (m *NameRequest) GetName() string
func (*NameRequest) ProtoMessage ¶
func (*NameRequest) ProtoMessage()
func (*NameRequest) Reset ¶
func (m *NameRequest) Reset()
func (*NameRequest) String ¶
func (m *NameRequest) String() string
func (*NameRequest) XXX_DiscardUnknown ¶
func (m *NameRequest) XXX_DiscardUnknown()
func (*NameRequest) XXX_Marshal ¶
func (m *NameRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*NameRequest) XXX_Merge ¶
func (dst *NameRequest) XXX_Merge(src proto.Message)
func (*NameRequest) XXX_Size ¶
func (m *NameRequest) XXX_Size() int
func (*NameRequest) XXX_Unmarshal ¶
func (m *NameRequest) XXX_Unmarshal(b []byte) error
type Response ¶
type Response struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Response) Descriptor ¶
func (*Response) GetMessage ¶
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) XXX_DiscardUnknown ¶
func (m *Response) XXX_DiscardUnknown()