pb

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package pb provides test protobuf definitions for integration tests. This file is manually created for testing (not generated by protoc).

本包提供集成测试用的 protobuf 定义。 本文件手动创建用于测试(非 protoc 生成的代码)。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterTestServiceServer

func RegisterTestServiceServer(s grpc.ServiceRegistrar, srv TestServiceServer)

RegisterTestServiceServer registers TestServiceServer.

RegisterTestServiceServer 注册 TestServiceServer。

Types

type EchoRequest

type EchoRequest struct {
	Body string
}

EchoRequest represents an echo request.

EchoRequest 表示 echo 请求。

type EchoResponse

type EchoResponse struct {
	Body     string
	Metadata map[string]string
}

EchoResponse represents an echo response.

EchoResponse 表示 echo 响应。

type HelloRequest

type HelloRequest struct {
	// 名字
	Name string
}

HelloRequest represents a simple hello request.

HelloRequest 表示简单的 hello 请求。

type HelloResponse

type HelloResponse struct {
	Message   string
	TraceId   string
	RequestId string
}

HelloResponse represents a hello response.

HelloResponse 表示 hello 响应。

type StreamRequest

type StreamRequest struct {
	Count int32
}

StreamRequest represents a stream request.

StreamRequest 表示 stream 请求。

type StreamResponse

type StreamResponse struct {
	Index   int32
	Message string
}

StreamResponse represents a stream response.

StreamResponse 表示 stream 响应。

type TestServiceClient

type TestServiceClient interface {
	SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error)
	Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error)
	StreamTest(ctx context.Context, in *StreamRequest, opts ...grpc.CallOption) (grpc.ClientStream, error)
}

TestServiceClient is the client API for TestService.

TestServiceClient 是 TestService 的客户端 API。

func NewTestServiceClient

func NewTestServiceClient(cc grpc.ClientConnInterface) TestServiceClient

NewTestServiceClient creates a new TestServiceClient.

NewTestServiceClient 创建新的 TestServiceClient。

type TestServiceServer

type TestServiceServer interface {
	SayHello(context.Context, *HelloRequest) (*HelloResponse, error)
	Echo(context.Context, *EchoRequest) (*EchoResponse, error)
	StreamTest(*StreamRequest, TestService_StreamTestServer) error
}

TestServiceServer is the server API for TestService.

TestServiceServer 是 TestService 的服务端 API。

type TestService_StreamTestServer

type TestService_StreamTestServer interface {
	Send(*StreamResponse) error
	grpc.ServerStream
}

TestService_StreamTestServer is the server stream for StreamTest.

TestService_StreamTestServer 是 StreamTest 的服务端 stream。

type UnimplementedTestServiceServer

type UnimplementedTestServiceServer struct{}

UnimplementedTestServiceServer must be embedded for forward compatibility.

UnimplementedTestServiceServer 必须嵌入以保持向前兼容。

func (UnimplementedTestServiceServer) Echo

func (UnimplementedTestServiceServer) SayHello

func (UnimplementedTestServiceServer) StreamTest

Jump to

Keyboard shortcuts

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