hello_http

package
v0.0.0-...-4cd5156 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package hello_http is a generated protocol buffer package.

It is generated from these files:

hello_http/hello_http.proto

It has these top-level messages:

HelloHTTPRequest
HelloHTTPResponse

Package hello_http is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHelloHTTPHandler

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

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

func RegisterHelloHTTPHandlerFromEndpoint

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

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

func RegisterHelloHTTPServer

func RegisterHelloHTTPServer(s *grpc.Server, srv HelloHTTPServer)

Types

type HelloHTTPClient

type HelloHTTPClient interface {
	// 定义SayHello方法
	SayHello(ctx context.Context, in *HelloHTTPRequest, opts ...grpc.CallOption) (*HelloHTTPResponse, error)
}

func NewHelloHTTPClient

func NewHelloHTTPClient(cc *grpc.ClientConn) HelloHTTPClient

type HelloHTTPRequest

type HelloHTTPRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
}

HelloRequest 请求结构

func (*HelloHTTPRequest) Descriptor

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

func (*HelloHTTPRequest) GetName

func (m *HelloHTTPRequest) GetName() string

func (*HelloHTTPRequest) ProtoMessage

func (*HelloHTTPRequest) ProtoMessage()

func (*HelloHTTPRequest) Reset

func (m *HelloHTTPRequest) Reset()

func (*HelloHTTPRequest) String

func (m *HelloHTTPRequest) String() string

type HelloHTTPResponse

type HelloHTTPResponse struct {
	Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"`
}

HelloResponse 响应结构

func (*HelloHTTPResponse) Descriptor

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

func (*HelloHTTPResponse) GetMessage

func (m *HelloHTTPResponse) GetMessage() string

func (*HelloHTTPResponse) ProtoMessage

func (*HelloHTTPResponse) ProtoMessage()

func (*HelloHTTPResponse) Reset

func (m *HelloHTTPResponse) Reset()

func (*HelloHTTPResponse) String

func (m *HelloHTTPResponse) String() string

type HelloHTTPServer

type HelloHTTPServer interface {
	// 定义SayHello方法
	SayHello(context.Context, *HelloHTTPRequest) (*HelloHTTPResponse, error)
}

Jump to

Keyboard shortcuts

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