Documentation ¶
Overview ¶
Package proto is a generated protocol buffer package.
It is generated from these files:
example/proto/demo.proto
It has these top-level messages:
Demo Custom
Package proto is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterDemoServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterDemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DemoServiceClient) error
- func RegisterDemoServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterDemoServiceServer(s *grpc.Server, srv DemoServiceServer)
- type Custom
- type Demo
- type DemoServiceClient
- type DemoServiceServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterDemoServiceHandler ¶
func RegisterDemoServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterDemoServiceHandler registers the http handlers for service DemoService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterDemoServiceHandlerClient ¶
func RegisterDemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DemoServiceClient) error
RegisterDemoServiceHandler registers the http handlers for service DemoService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DemoServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DemoServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "DemoServiceClient" to call the correct interceptors.
func RegisterDemoServiceHandlerFromEndpoint ¶
func RegisterDemoServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterDemoServiceHandlerFromEndpoint is same as RegisterDemoServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterDemoServiceServer ¶
func RegisterDemoServiceServer(s *grpc.Server, srv DemoServiceServer)
Types ¶
type Custom ¶
type Custom struct {
DoItYourself string `protobuf:"bytes,1,opt,name=doItYourself" json:"doItYourself,omitempty"`
}
This message left as is to show that we can provide our own preprocessors
func (*Custom) Descriptor ¶
func (*Custom) GetDoItYourself ¶
func (*Custom) ProtoMessage ¶
func (*Custom) ProtoMessage()
type Demo ¶
type Demo struct { // Also it is possible to specify additional method on field level PreprocessedField string `protobuf:"bytes,1,opt,name=preprocessedField" json:"preprocessedField,omitempty"` // Preprocessor automatically checks if field is repeated and generates methods accordingly PreprocessedRepeatedField []string `protobuf:"bytes,2,rep,name=preprocessedRepeatedField" json:"preprocessedRepeatedField,omitempty"` // If a field does not fit preprocess method, it is just ignored Ignored int32 `protobuf:"varint,3,opt,name=ignored" json:"ignored,omitempty"` }
func (*Demo) Descriptor ¶
func (*Demo) GetIgnored ¶
func (*Demo) GetPreprocessedField ¶
func (*Demo) GetPreprocessedRepeatedField ¶
func (*Demo) Preprocess ¶
func (*Demo) ProtoMessage ¶
func (*Demo) ProtoMessage()
type DemoServiceClient ¶
type DemoServiceClient interface {
Echo(ctx context.Context, in *Demo, opts ...grpc.CallOption) (*Demo, error)
}
func NewDemoServiceClient ¶
func NewDemoServiceClient(cc *grpc.ClientConn) DemoServiceClient