Documentation
¶
Overview ¶
Package ping is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterPingServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterPingServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PingServiceClient) error
- func RegisterPingServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterPingServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PingServiceServer) error
- func RegisterPingServiceServer(s *grpc.Server, srv PingServiceServer)
- type MessageInput
- type MessageOutput
- type PingServiceClient
- type PingServiceServer
- type UnimplementedPingServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_ping_proto protoreflect.FileDescriptor
Functions ¶
func RegisterPingServiceHandler ¶
func RegisterPingServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterPingServiceHandler registers the http handlers for service PingService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterPingServiceHandlerClient ¶
func RegisterPingServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PingServiceClient) error
RegisterPingServiceHandlerClient registers the http handlers for service PingService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PingServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PingServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "PingServiceClient" to call the correct interceptors.
func RegisterPingServiceHandlerFromEndpoint ¶
func RegisterPingServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterPingServiceHandlerFromEndpoint is same as RegisterPingServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterPingServiceHandlerServer ¶
func RegisterPingServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PingServiceServer) error
RegisterPingServiceHandlerServer registers the http handlers for service PingService to "mux". UnaryRPC :call PingServiceServer 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 RegisterPingServiceHandlerFromEndpoint instead.
func RegisterPingServiceServer ¶
func RegisterPingServiceServer(s *grpc.Server, srv PingServiceServer)
Types ¶
type MessageInput ¶
type MessageInput struct { Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` // contains filtered or unexported fields }
func (*MessageInput) Descriptor
deprecated
func (*MessageInput) Descriptor() ([]byte, []int)
Deprecated: Use MessageInput.ProtoReflect.Descriptor instead.
func (*MessageInput) GetMsg ¶
func (x *MessageInput) GetMsg() string
func (*MessageInput) ProtoMessage ¶
func (*MessageInput) ProtoMessage()
func (*MessageInput) ProtoReflect ¶
func (x *MessageInput) ProtoReflect() protoreflect.Message
func (*MessageInput) Reset ¶
func (x *MessageInput) Reset()
func (*MessageInput) String ¶
func (x *MessageInput) String() string
type MessageOutput ¶
type MessageOutput struct { Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` // contains filtered or unexported fields }
func (*MessageOutput) Descriptor
deprecated
func (*MessageOutput) Descriptor() ([]byte, []int)
Deprecated: Use MessageOutput.ProtoReflect.Descriptor instead.
func (*MessageOutput) GetMsg ¶
func (x *MessageOutput) GetMsg() string
func (*MessageOutput) ProtoMessage ¶
func (*MessageOutput) ProtoMessage()
func (*MessageOutput) ProtoReflect ¶
func (x *MessageOutput) ProtoReflect() protoreflect.Message
func (*MessageOutput) Reset ¶
func (x *MessageOutput) Reset()
func (*MessageOutput) String ¶
func (x *MessageOutput) String() string
type PingServiceClient ¶
type PingServiceClient interface {
Echo(ctx context.Context, in *MessageInput, opts ...grpc.CallOption) (*MessageOutput, error)
}
PingServiceClient is the client API for PingService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewPingServiceClient ¶
func NewPingServiceClient(cc grpc.ClientConnInterface) PingServiceClient
type PingServiceServer ¶
type PingServiceServer interface {
Echo(context.Context, *MessageInput) (*MessageOutput, error)
}
PingServiceServer is the server API for PingService service.
type UnimplementedPingServiceServer ¶
type UnimplementedPingServiceServer struct { }
UnimplementedPingServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedPingServiceServer) Echo ¶
func (*UnimplementedPingServiceServer) Echo(context.Context, *MessageInput) (*MessageOutput, error)