Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterTestGRPCServer(s grpc.ServiceRegistrar, srv TestGRPCServer)
- func TestClient(ip string, port int, vNet *netstack.Net) error
- func TestServer(ip string, port int, vNet *netstack.Net) error
- type TestGRPCClient
- type TestGRPCServer
- type TestRequest
- type TestResponse
- type UnimplementedTestGRPCServer
- type UnsafeTestGRPCServer
Constants ¶
const (
TestGRPC_Test_FullMethodName = "/keyx.TestGRPC/Test"
)
Variables ¶
var File_examples_grpc_grpc_proto protoreflect.FileDescriptor
var TestGRPC_ServiceDesc = grpc.ServiceDesc{ ServiceName: "keyx.TestGRPC", HandlerType: (*TestGRPCServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Test", Handler: _TestGRPC_Test_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "examples/grpc/grpc.proto", }
TestGRPC_ServiceDesc is the grpc.ServiceDesc for TestGRPC service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterTestGRPCServer ¶
func RegisterTestGRPCServer(s grpc.ServiceRegistrar, srv TestGRPCServer)
Types ¶
type TestGRPCClient ¶
type TestGRPCClient interface { // Test sends a message and receives a message. Test(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (*TestResponse, error) }
TestGRPCClient is the client API for TestGRPC 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.
TestGRPC is a simple GRPC service that sends a message and receives a message.
func NewTestGRPCClient ¶
func NewTestGRPCClient(cc grpc.ClientConnInterface) TestGRPCClient
type TestGRPCServer ¶
type TestGRPCServer interface { // Test sends a message and receives a message. Test(context.Context, *TestRequest) (*TestResponse, error) // contains filtered or unexported methods }
TestGRPCServer is the server API for TestGRPC service. All implementations must embed UnimplementedTestGRPCServer for forward compatibility.
TestGRPC is a simple GRPC service that sends a message and receives a message.
type TestRequest ¶
type TestRequest struct { Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"` // contains filtered or unexported fields }
TestRequest is the request message containing the message to send.
func (*TestRequest) Descriptor
deprecated
func (*TestRequest) Descriptor() ([]byte, []int)
Deprecated: Use TestRequest.ProtoReflect.Descriptor instead.
func (*TestRequest) GetMsg ¶
func (x *TestRequest) GetMsg() string
func (*TestRequest) ProtoMessage ¶
func (*TestRequest) ProtoMessage()
func (*TestRequest) ProtoReflect ¶
func (x *TestRequest) ProtoReflect() protoreflect.Message
func (*TestRequest) Reset ¶
func (x *TestRequest) Reset()
func (*TestRequest) String ¶
func (x *TestRequest) String() string
type TestResponse ¶
type TestResponse struct { Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"` // contains filtered or unexported fields }
TestResponse is the response message containing the message received.
func (*TestResponse) Descriptor
deprecated
func (*TestResponse) Descriptor() ([]byte, []int)
Deprecated: Use TestResponse.ProtoReflect.Descriptor instead.
func (*TestResponse) GetMsg ¶
func (x *TestResponse) GetMsg() string
func (*TestResponse) ProtoMessage ¶
func (*TestResponse) ProtoMessage()
func (*TestResponse) ProtoReflect ¶
func (x *TestResponse) ProtoReflect() protoreflect.Message
func (*TestResponse) Reset ¶
func (x *TestResponse) Reset()
func (*TestResponse) String ¶
func (x *TestResponse) String() string
type UnimplementedTestGRPCServer ¶
type UnimplementedTestGRPCServer struct{}
UnimplementedTestGRPCServer 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 (UnimplementedTestGRPCServer) Test ¶
func (UnimplementedTestGRPCServer) Test(context.Context, *TestRequest) (*TestResponse, error)
type UnsafeTestGRPCServer ¶
type UnsafeTestGRPCServer interface {
// contains filtered or unexported methods
}
UnsafeTestGRPCServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TestGRPCServer will result in compilation errors.