Documentation ¶
Overview ¶
Package example is a generated protocol buffer package.
It is generated from these files:
my_service.proto
It has these top-level messages:
StringMessage
Package example is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterYourServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterYourServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client YourServiceClient) error
- func RegisterYourServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterYourServiceServer(s *grpc.Server, srv YourServiceServer)
- type StringMessage
- type YourServiceClient
- type YourServiceServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterYourServiceHandler ¶
func RegisterYourServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterYourServiceHandler registers the http handlers for service YourService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterYourServiceHandlerClient ¶
func RegisterYourServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client YourServiceClient) error
RegisterYourServiceHandler registers the http handlers for service YourService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "YourServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "YourServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "YourServiceClient" to call the correct interceptors.
func RegisterYourServiceHandlerFromEndpoint ¶
func RegisterYourServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterYourServiceHandlerFromEndpoint is same as RegisterYourServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterYourServiceServer ¶
func RegisterYourServiceServer(s *grpc.Server, srv YourServiceServer)
Types ¶
type StringMessage ¶
type StringMessage struct {
Value string `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"`
}
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
type YourServiceClient ¶
type YourServiceClient interface {
Echo(ctx context.Context, in *StringMessage, opts ...grpc.CallOption) (*StringMessage, error)
}
func NewYourServiceClient ¶
func NewYourServiceClient(cc *grpc.ClientConn) YourServiceClient
type YourServiceServer ¶
type YourServiceServer interface {
Echo(context.Context, *StringMessage) (*StringMessage, error)
}