testpb

package
Version: v0.13.8 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func RegisterFooServer

func RegisterFooServer(s grpc.ServiceRegistrar, srv FooServer)

Types

type FooClient

type FooClient interface {
	Single(ctx context.Context, in *FooRequest, opts ...grpc.CallOption) (*FooResponse, error)
	Multiple(ctx context.Context, opts ...grpc.CallOption) (Foo_MultipleClient, error)
}

FooClient is the client API for Foo 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 NewFooClient

func NewFooClient(cc grpc.ClientConnInterface) FooClient

func NewTestClient

func NewTestClient(l *testing.T) (client FooClient, cleanup func())

NewTestClient is used for internal testing only. It creates a grpc server and client. It returns client and cleanup function to close the connection and gracefully stop the server.

type FooRequest

type FooRequest struct {
	Fail       bool  `protobuf:"varint,1,opt,name=fail,proto3" json:"fail,omitempty"`
	SleepNanos int64 `protobuf:"varint,2,opt,name=sleep_nanos,json=sleepNanos,proto3" json:"sleep_nanos,omitempty"`
	// contains filtered or unexported fields
}

func (*FooRequest) Descriptor deprecated

This method has been deprecated.
func (*FooRequest) Descriptor() ([]byte, []int)

Deprecated: Use FooRequest.ProtoReflect.Descriptor instead.

func (*FooRequest) GetFail

func (x *FooRequest) GetFail() bool

func (*FooRequest) GetSleepNanos

func (x *FooRequest) GetSleepNanos() int64

func (*FooRequest) ProtoMessage

func (*FooRequest) ProtoMessage()

func (*FooRequest) ProtoReflect

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

func (*FooRequest) Reset

func (x *FooRequest) Reset()

func (*FooRequest) String

func (x *FooRequest) String() string

type FooResponse

type FooResponse struct {
	// contains filtered or unexported fields
}

func (*FooResponse) Descriptor deprecated

This method has been deprecated.
func (*FooResponse) Descriptor() ([]byte, []int)

Deprecated: Use FooResponse.ProtoReflect.Descriptor instead.

func (*FooResponse) ProtoMessage

func (*FooResponse) ProtoMessage()

func (*FooResponse) ProtoReflect

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

func (*FooResponse) Reset

func (x *FooResponse) Reset()

func (*FooResponse) String

func (x *FooResponse) String() string

type FooServer

type FooServer interface {
	Single(context.Context, *FooRequest) (*FooResponse, error)
	Multiple(Foo_MultipleServer) error
	// contains filtered or unexported methods
}

FooServer is the server API for Foo service. All implementations must embed UnimplementedFooServer for forward compatibility

type Foo_MultipleClient

type Foo_MultipleClient interface {
	Send(*FooRequest) error
	Recv() (*FooResponse, error)
	grpc.ClientStream
}

type Foo_MultipleServer

type Foo_MultipleServer interface {
	Send(*FooResponse) error
	Recv() (*FooRequest, error)
	grpc.ServerStream
}

type UnimplementedFooServer

type UnimplementedFooServer struct {
}

UnimplementedFooServer must be embedded to have forward compatible implementations.

func (UnimplementedFooServer) Multiple

func (UnimplementedFooServer) Single

type UnsafeFooServer

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto