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