testproto

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package testproto contains the generated testproto grpc code. Additionally it contains a function to start the server and returns a NATS connection to it. NATS is used in the tests.

Index

Constants

This section is empty.

Variables

View Source
var File_testproto_test_proto protoreflect.FileDescriptor
View Source
var Test_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "testproto.Test",
	HandlerType: (*TestServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Unary",
			Handler:    _Test_Unary_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ServerStream",
			Handler:       _Test_ServerStream_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "ClientStream",
			Handler:       _Test_ClientStream_Handler,
			ClientStreams: true,
		},
		{
			StreamName:    "BiDiStream",
			Handler:       _Test_BiDiStream_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "testproto/test.proto",
}

Test_ServiceDesc is the grpc.ServiceDesc for Test service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func NewTestConn

func NewTestConn() (conn *nats.Conn, shutdown func(), err error)

NewTestConn creates a nats test connection and returns a shutdown function to be deferred.

func RegisterTestServer

func RegisterTestServer(s grpc.ServiceRegistrar, srv TestServer)

Types

type BiDiStreamReq

type BiDiStreamReq struct {

	// The request message.
	Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

func (*BiDiStreamReq) Descriptor deprecated

func (*BiDiStreamReq) Descriptor() ([]byte, []int)

Deprecated: Use BiDiStreamReq.ProtoReflect.Descriptor instead.

func (*BiDiStreamReq) GetMsg

func (x *BiDiStreamReq) GetMsg() string

func (*BiDiStreamReq) ProtoMessage

func (*BiDiStreamReq) ProtoMessage()

func (*BiDiStreamReq) ProtoReflect

func (x *BiDiStreamReq) ProtoReflect() protoreflect.Message

func (*BiDiStreamReq) Reset

func (x *BiDiStreamReq) Reset()

func (*BiDiStreamReq) String

func (x *BiDiStreamReq) String() string

type BiDiStreamResp

type BiDiStreamResp struct {

	// The response message.
	Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

func (*BiDiStreamResp) Descriptor deprecated

func (*BiDiStreamResp) Descriptor() ([]byte, []int)

Deprecated: Use BiDiStreamResp.ProtoReflect.Descriptor instead.

func (*BiDiStreamResp) GetMsg

func (x *BiDiStreamResp) GetMsg() string

func (*BiDiStreamResp) ProtoMessage

func (*BiDiStreamResp) ProtoMessage()

func (*BiDiStreamResp) ProtoReflect

func (x *BiDiStreamResp) ProtoReflect() protoreflect.Message

func (*BiDiStreamResp) Reset

func (x *BiDiStreamResp) Reset()

func (*BiDiStreamResp) String

func (x *BiDiStreamResp) String() string

type ClientStreamReq

type ClientStreamReq struct {

	// The request message.
	Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

func (*ClientStreamReq) Descriptor deprecated

func (*ClientStreamReq) Descriptor() ([]byte, []int)

Deprecated: Use ClientStreamReq.ProtoReflect.Descriptor instead.

func (*ClientStreamReq) GetMsg

func (x *ClientStreamReq) GetMsg() string

func (*ClientStreamReq) ProtoMessage

func (*ClientStreamReq) ProtoMessage()

func (*ClientStreamReq) ProtoReflect

func (x *ClientStreamReq) ProtoReflect() protoreflect.Message

func (*ClientStreamReq) Reset

func (x *ClientStreamReq) Reset()

func (*ClientStreamReq) String

func (x *ClientStreamReq) String() string

type ClientStreamResp

type ClientStreamResp struct {

	// The response message.
	Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

func (*ClientStreamResp) Descriptor deprecated

func (*ClientStreamResp) Descriptor() ([]byte, []int)

Deprecated: Use ClientStreamResp.ProtoReflect.Descriptor instead.

func (*ClientStreamResp) GetMsg

func (x *ClientStreamResp) GetMsg() string

func (*ClientStreamResp) ProtoMessage

func (*ClientStreamResp) ProtoMessage()

func (*ClientStreamResp) ProtoReflect

func (x *ClientStreamResp) ProtoReflect() protoreflect.Message

func (*ClientStreamResp) Reset

func (x *ClientStreamResp) Reset()

func (*ClientStreamResp) String

func (x *ClientStreamResp) String() string

type ServerStreamReq

type ServerStreamReq struct {

	// The request message.
	Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

func (*ServerStreamReq) Descriptor deprecated

func (*ServerStreamReq) Descriptor() ([]byte, []int)

Deprecated: Use ServerStreamReq.ProtoReflect.Descriptor instead.

func (*ServerStreamReq) GetMsg

func (x *ServerStreamReq) GetMsg() string

func (*ServerStreamReq) ProtoMessage

func (*ServerStreamReq) ProtoMessage()

func (*ServerStreamReq) ProtoReflect

func (x *ServerStreamReq) ProtoReflect() protoreflect.Message

func (*ServerStreamReq) Reset

func (x *ServerStreamReq) Reset()

func (*ServerStreamReq) String

func (x *ServerStreamReq) String() string

type ServerStreamResp

type ServerStreamResp struct {

	// The response message.
	Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

func (*ServerStreamResp) Descriptor deprecated

func (*ServerStreamResp) Descriptor() ([]byte, []int)

Deprecated: Use ServerStreamResp.ProtoReflect.Descriptor instead.

func (*ServerStreamResp) GetMsg

func (x *ServerStreamResp) GetMsg() string

func (*ServerStreamResp) ProtoMessage

func (*ServerStreamResp) ProtoMessage()

func (*ServerStreamResp) ProtoReflect

func (x *ServerStreamResp) ProtoReflect() protoreflect.Message

func (*ServerStreamResp) Reset

func (x *ServerStreamResp) Reset()

func (*ServerStreamResp) String

func (x *ServerStreamResp) String() string

type TestClient

type TestClient interface {
	// Unary implements a unary RPC method for testing.
	Unary(ctx context.Context, in *UnaryReq, opts ...grpc.CallOption) (*UnaryResp, error)
	// ServerStream implements a server streaming RPC method for testing.
	ServerStream(ctx context.Context, in *ServerStreamReq, opts ...grpc.CallOption) (Test_ServerStreamClient, error)
	// ClientStream implements a client streaming RPC method for testing.
	ClientStream(ctx context.Context, opts ...grpc.CallOption) (Test_ClientStreamClient, error)
	// BiDiStream implements a bidirectional streaming RPC method for testing.
	BiDiStream(ctx context.Context, opts ...grpc.CallOption) (Test_BiDiStreamClient, error)
}

TestClient is the client API for Test 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 NewTestClient

func NewTestClient(cc grpc.ClientConnInterface) TestClient

type TestServer

type TestServer interface {
	// Unary implements a unary RPC method for testing.
	Unary(context.Context, *UnaryReq) (*UnaryResp, error)
	// ServerStream implements a server streaming RPC method for testing.
	ServerStream(*ServerStreamReq, Test_ServerStreamServer) error
	// ClientStream implements a client streaming RPC method for testing.
	ClientStream(Test_ClientStreamServer) error
	// BiDiStream implements a bidirectional streaming RPC method for testing.
	BiDiStream(Test_BiDiStreamServer) error
	// contains filtered or unexported methods
}

TestServer is the server API for Test service. All implementations must embed UnimplementedTestServer for forward compatibility

type Test_BiDiStreamClient

type Test_BiDiStreamClient interface {
	Send(*BiDiStreamReq) error
	Recv() (*BiDiStreamResp, error)
	grpc.ClientStream
}

type Test_BiDiStreamServer

type Test_BiDiStreamServer interface {
	Send(*BiDiStreamResp) error
	Recv() (*BiDiStreamReq, error)
	grpc.ServerStream
}

type Test_ClientStreamClient

type Test_ClientStreamClient interface {
	Send(*ClientStreamReq) error
	CloseAndRecv() (*ClientStreamResp, error)
	grpc.ClientStream
}

type Test_ClientStreamServer

type Test_ClientStreamServer interface {
	SendAndClose(*ClientStreamResp) error
	Recv() (*ClientStreamReq, error)
	grpc.ServerStream
}

type Test_ServerStreamClient

type Test_ServerStreamClient interface {
	Recv() (*ServerStreamResp, error)
	grpc.ClientStream
}

type Test_ServerStreamServer

type Test_ServerStreamServer interface {
	Send(*ServerStreamResp) error
	grpc.ServerStream
}

type UnaryReq

type UnaryReq struct {

	// The request message.
	Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

func (*UnaryReq) Descriptor deprecated

func (*UnaryReq) Descriptor() ([]byte, []int)

Deprecated: Use UnaryReq.ProtoReflect.Descriptor instead.

func (*UnaryReq) GetMsg

func (x *UnaryReq) GetMsg() string

func (*UnaryReq) ProtoMessage

func (*UnaryReq) ProtoMessage()

func (*UnaryReq) ProtoReflect

func (x *UnaryReq) ProtoReflect() protoreflect.Message

func (*UnaryReq) Reset

func (x *UnaryReq) Reset()

func (*UnaryReq) String

func (x *UnaryReq) String() string

type UnaryResp

type UnaryResp struct {

	// The response message.
	Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

func (*UnaryResp) Descriptor deprecated

func (*UnaryResp) Descriptor() ([]byte, []int)

Deprecated: Use UnaryResp.ProtoReflect.Descriptor instead.

func (*UnaryResp) GetMsg

func (x *UnaryResp) GetMsg() string

func (*UnaryResp) ProtoMessage

func (*UnaryResp) ProtoMessage()

func (*UnaryResp) ProtoReflect

func (x *UnaryResp) ProtoReflect() protoreflect.Message

func (*UnaryResp) Reset

func (x *UnaryResp) Reset()

func (*UnaryResp) String

func (x *UnaryResp) String() string

type UnimplementedTestServer

type UnimplementedTestServer struct {
}

UnimplementedTestServer must be embedded to have forward compatible implementations.

func (UnimplementedTestServer) BiDiStream

func (UnimplementedTestServer) ClientStream

func (UnimplementedTestServer) ServerStream

func (UnimplementedTestServer) Unary

type UnsafeTestServer

type UnsafeTestServer interface {
	// contains filtered or unexported methods
}

UnsafeTestServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TestServer will result in compilation errors.

Directories

Path Synopsis
Package testclient creates a new client for the testproto service used in tests.
Package testclient creates a new client for the testproto service used in tests.
Package testserver implements the testproto service used in tests.
Package testserver implements the testproto service used in tests.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL