Documentation
¶
Overview ¶
Package platformtestv1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterEchoServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterEchoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EchoServiceClient) error
- func RegisterEchoServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterEchoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EchoServiceServer) error
- func RegisterEchoServiceServer(s grpc.ServiceRegistrar, srv EchoServiceServer)
- type EchoRequest
- type EchoResponse
- func (*EchoResponse) Descriptor() ([]byte, []int)deprecated
- func (x *EchoResponse) GetLength() int32
- func (x *EchoResponse) GetMessageText() string
- func (x *EchoResponse) GetShouted() bool
- func (*EchoResponse) ProtoMessage()
- func (x *EchoResponse) ProtoReflect() protoreflect.Message
- func (x *EchoResponse) Reset()
- func (x *EchoResponse) String() string
- type EchoServiceClient
- type EchoServiceServer
- type FailRequest
- type FailResponse
- type UnimplementedEchoServiceServer
- type UnsafeEchoServiceServer
Constants ¶
const ( EchoService_Echo_FullMethodName = "/platformtest.v1.EchoService/Echo" EchoService_Fail_FullMethodName = "/platformtest.v1.EchoService/Fail" )
Variables ¶
var EchoService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "platformtest.v1.EchoService", HandlerType: (*EchoServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Echo", Handler: _EchoService_Echo_Handler, }, { MethodName: "Fail", Handler: _EchoService_Fail_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "platformtest/v1/echo.proto", }
EchoService_ServiceDesc is the grpc.ServiceDesc for EchoService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_platformtest_v1_echo_proto protoreflect.FileDescriptor
Functions ¶
func RegisterEchoServiceHandler ¶
func RegisterEchoServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterEchoServiceHandler registers the http handlers for service EchoService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterEchoServiceHandlerClient ¶
func RegisterEchoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EchoServiceClient) error
RegisterEchoServiceHandlerClient registers the http handlers for service EchoService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "EchoServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "EchoServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "EchoServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares.
func RegisterEchoServiceHandlerFromEndpoint ¶
func RegisterEchoServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterEchoServiceHandlerFromEndpoint is same as RegisterEchoServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterEchoServiceHandlerServer ¶
func RegisterEchoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EchoServiceServer) error
RegisterEchoServiceHandlerServer registers the http handlers for service EchoService to "mux". UnaryRPC :call EchoServiceServer 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 RegisterEchoServiceHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
func RegisterEchoServiceServer ¶
func RegisterEchoServiceServer(s grpc.ServiceRegistrar, srv EchoServiceServer)
Types ¶
type EchoRequest ¶
type EchoRequest struct {
MessageText string `protobuf:"bytes,1,opt,name=message_text,json=messageText,proto3" json:"message_text,omitempty"`
// contains filtered or unexported fields
}
func (*EchoRequest) Descriptor
deprecated
func (*EchoRequest) Descriptor() ([]byte, []int)
Deprecated: Use EchoRequest.ProtoReflect.Descriptor instead.
func (*EchoRequest) GetMessageText ¶
func (x *EchoRequest) GetMessageText() string
func (*EchoRequest) ProtoMessage ¶
func (*EchoRequest) ProtoMessage()
func (*EchoRequest) ProtoReflect ¶
func (x *EchoRequest) ProtoReflect() protoreflect.Message
func (*EchoRequest) Reset ¶
func (x *EchoRequest) Reset()
func (*EchoRequest) String ¶
func (x *EchoRequest) String() string
type EchoResponse ¶
type EchoResponse struct {
MessageText string `protobuf:"bytes,1,opt,name=message_text,json=messageText,proto3" json:"message_text,omitempty"`
Length int32 `protobuf:"varint,2,opt,name=length,proto3" json:"length,omitempty"`
Shouted bool `protobuf:"varint,3,opt,name=shouted,proto3" json:"shouted,omitempty"`
// contains filtered or unexported fields
}
func (*EchoResponse) Descriptor
deprecated
func (*EchoResponse) Descriptor() ([]byte, []int)
Deprecated: Use EchoResponse.ProtoReflect.Descriptor instead.
func (*EchoResponse) GetLength ¶
func (x *EchoResponse) GetLength() int32
func (*EchoResponse) GetMessageText ¶
func (x *EchoResponse) GetMessageText() string
func (*EchoResponse) GetShouted ¶
func (x *EchoResponse) GetShouted() bool
func (*EchoResponse) ProtoMessage ¶
func (*EchoResponse) ProtoMessage()
func (*EchoResponse) ProtoReflect ¶
func (x *EchoResponse) ProtoReflect() protoreflect.Message
func (*EchoResponse) Reset ¶
func (x *EchoResponse) Reset()
func (*EchoResponse) String ¶
func (x *EchoResponse) String() string
type EchoServiceClient ¶
type EchoServiceClient interface {
Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error)
Fail(ctx context.Context, in *FailRequest, opts ...grpc.CallOption) (*FailResponse, error)
}
EchoServiceClient is the client API for EchoService 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 NewEchoServiceClient ¶
func NewEchoServiceClient(cc grpc.ClientConnInterface) EchoServiceClient
type EchoServiceServer ¶
type EchoServiceServer interface {
Echo(context.Context, *EchoRequest) (*EchoResponse, error)
Fail(context.Context, *FailRequest) (*FailResponse, error)
// contains filtered or unexported methods
}
EchoServiceServer is the server API for EchoService service. All implementations must embed UnimplementedEchoServiceServer for forward compatibility.
type FailRequest ¶
type FailRequest struct {
// panic, internal, not_found or slow
Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"`
// contains filtered or unexported fields
}
func (*FailRequest) Descriptor
deprecated
func (*FailRequest) Descriptor() ([]byte, []int)
Deprecated: Use FailRequest.ProtoReflect.Descriptor instead.
func (*FailRequest) GetKind ¶
func (x *FailRequest) GetKind() string
func (*FailRequest) ProtoMessage ¶
func (*FailRequest) ProtoMessage()
func (*FailRequest) ProtoReflect ¶
func (x *FailRequest) ProtoReflect() protoreflect.Message
func (*FailRequest) Reset ¶
func (x *FailRequest) Reset()
func (*FailRequest) String ¶
func (x *FailRequest) String() string
type FailResponse ¶
type FailResponse struct {
// contains filtered or unexported fields
}
func (*FailResponse) Descriptor
deprecated
func (*FailResponse) Descriptor() ([]byte, []int)
Deprecated: Use FailResponse.ProtoReflect.Descriptor instead.
func (*FailResponse) ProtoMessage ¶
func (*FailResponse) ProtoMessage()
func (*FailResponse) ProtoReflect ¶
func (x *FailResponse) ProtoReflect() protoreflect.Message
func (*FailResponse) Reset ¶
func (x *FailResponse) Reset()
func (*FailResponse) String ¶
func (x *FailResponse) String() string
type UnimplementedEchoServiceServer ¶
type UnimplementedEchoServiceServer struct{}
UnimplementedEchoServiceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedEchoServiceServer) Echo ¶
func (UnimplementedEchoServiceServer) Echo(context.Context, *EchoRequest) (*EchoResponse, error)
func (UnimplementedEchoServiceServer) Fail ¶
func (UnimplementedEchoServiceServer) Fail(context.Context, *FailRequest) (*FailResponse, error)
type UnsafeEchoServiceServer ¶
type UnsafeEchoServiceServer interface {
// contains filtered or unexported methods
}
UnsafeEchoServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EchoServiceServer will result in compilation errors.