Documentation ¶
Overview ¶
Package build is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterGreetingHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterGreetingHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GreetingClient) error
- func RegisterGreetingHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterGreetingHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GreetingServer) error
- func RegisterGreetingServer(s grpc.ServiceRegistrar, srv GreetingServer)
- type GreetingClient
- type GreetingRequest
- type GreetingResponse
- type GreetingServer
- type UnimplementedGreetingServer
- type UnsafeGreetingServer
Constants ¶
This section is empty.
Variables ¶
var File_greeting_proto protoreflect.FileDescriptor
var Greeting_ServiceDesc = grpc.ServiceDesc{ ServiceName: "build.Greeting", HandlerType: (*GreetingServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Greet", Handler: _Greeting_Greet_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "greeting.proto", }
Greeting_ServiceDesc is the grpc.ServiceDesc for Greeting service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterGreetingHandler ¶
func RegisterGreetingHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterGreetingHandler registers the http handlers for service Greeting to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterGreetingHandlerClient ¶
func RegisterGreetingHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GreetingClient) error
RegisterGreetingHandlerClient registers the http handlers for service Greeting to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "GreetingClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "GreetingClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "GreetingClient" to call the correct interceptors.
func RegisterGreetingHandlerFromEndpoint ¶
func RegisterGreetingHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterGreetingHandlerFromEndpoint is same as RegisterGreetingHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterGreetingHandlerServer ¶
func RegisterGreetingHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GreetingServer) error
RegisterGreetingHandlerServer registers the http handlers for service Greeting to "mux". UnaryRPC :call GreetingServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterGreetingHandlerFromEndpoint instead.
func RegisterGreetingServer ¶
func RegisterGreetingServer(s grpc.ServiceRegistrar, srv GreetingServer)
Types ¶
type GreetingClient ¶
type GreetingClient interface {
Greet(ctx context.Context, in *GreetingRequest, opts ...grpc.CallOption) (*GreetingResponse, error)
}
GreetingClient is the client API for Greeting service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewGreetingClient ¶
func NewGreetingClient(cc grpc.ClientConnInterface) GreetingClient
type GreetingRequest ¶
type GreetingRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*GreetingRequest) Descriptor
deprecated
func (*GreetingRequest) Descriptor() ([]byte, []int)
Deprecated: Use GreetingRequest.ProtoReflect.Descriptor instead.
func (*GreetingRequest) GetName ¶
func (x *GreetingRequest) GetName() string
func (*GreetingRequest) ProtoMessage ¶
func (*GreetingRequest) ProtoMessage()
func (*GreetingRequest) ProtoReflect ¶
func (x *GreetingRequest) ProtoReflect() protoreflect.Message
func (*GreetingRequest) Reset ¶
func (x *GreetingRequest) Reset()
func (*GreetingRequest) String ¶
func (x *GreetingRequest) String() string
type GreetingResponse ¶
type GreetingResponse struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*GreetingResponse) Descriptor
deprecated
func (*GreetingResponse) Descriptor() ([]byte, []int)
Deprecated: Use GreetingResponse.ProtoReflect.Descriptor instead.
func (*GreetingResponse) GetMessage ¶
func (x *GreetingResponse) GetMessage() string
func (*GreetingResponse) ProtoMessage ¶
func (*GreetingResponse) ProtoMessage()
func (*GreetingResponse) ProtoReflect ¶
func (x *GreetingResponse) ProtoReflect() protoreflect.Message
func (*GreetingResponse) Reset ¶
func (x *GreetingResponse) Reset()
func (*GreetingResponse) String ¶
func (x *GreetingResponse) String() string
type GreetingServer ¶
type GreetingServer interface { Greet(context.Context, *GreetingRequest) (*GreetingResponse, error) // contains filtered or unexported methods }
GreetingServer is the server API for Greeting service. All implementations must embed UnimplementedGreetingServer for forward compatibility
type UnimplementedGreetingServer ¶
type UnimplementedGreetingServer struct { }
UnimplementedGreetingServer must be embedded to have forward compatible implementations.
func (UnimplementedGreetingServer) Greet ¶
func (UnimplementedGreetingServer) Greet(context.Context, *GreetingRequest) (*GreetingResponse, error)
type UnsafeGreetingServer ¶
type UnsafeGreetingServer interface {
// contains filtered or unexported methods
}
UnsafeGreetingServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GreetingServer will result in compilation errors.