pro

package
v0.0.0-...-cbd8b7f Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Greeter_GetStream_FullMethodName = "/pro.Greeter/GetStream"
	Greeter_PutStream_FullMethodName = "/pro.Greeter/PutStream"
	Greeter_AllStream_FullMethodName = "/pro.Greeter/AllStream"
)

Variables

View Source
var File_pet_v1_greeter_proto protoreflect.FileDescriptor
View Source
var Greeter_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pro.Greeter",
	HandlerType: (*GreeterServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "GetStream",
			Handler:       _Greeter_GetStream_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "PutStream",
			Handler:       _Greeter_PutStream_Handler,
			ClientStreams: true,
		},
		{
			StreamName:    "AllStream",
			Handler:       _Greeter_AllStream_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "pet/v1/greeter.proto",
}

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

Functions

func RegisterGreeterServer

func RegisterGreeterServer(s grpc.ServiceRegistrar, srv GreeterServer)

Types

type GreeterClient

type GreeterClient interface {
	// 以下 分别是 服务端 推送流, 客户端 推送流 ,双向流。
	GetStream(ctx context.Context, in *StreamReqData, opts ...grpc.CallOption) (Greeter_GetStreamClient, error)
	PutStream(ctx context.Context, opts ...grpc.CallOption) (Greeter_PutStreamClient, error)
	AllStream(ctx context.Context, opts ...grpc.CallOption) (Greeter_AllStreamClient, error)
}

GreeterClient is the client API for Greeter 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 NewGreeterClient

func NewGreeterClient(cc grpc.ClientConnInterface) GreeterClient

type GreeterServer

type GreeterServer interface {
	// 以下 分别是 服务端 推送流, 客户端 推送流 ,双向流。
	GetStream(*StreamReqData, Greeter_GetStreamServer) error
	PutStream(Greeter_PutStreamServer) error
	AllStream(Greeter_AllStreamServer) error
	// contains filtered or unexported methods
}

GreeterServer is the server API for Greeter service. All implementations must embed UnimplementedGreeterServer for forward compatibility

type Greeter_AllStreamClient

type Greeter_AllStreamClient interface {
	Send(*StreamReqData) error
	Recv() (*StreamResData, error)
	grpc.ClientStream
}

type Greeter_AllStreamServer

type Greeter_AllStreamServer interface {
	Send(*StreamResData) error
	Recv() (*StreamReqData, error)
	grpc.ServerStream
}

type Greeter_GetStreamClient

type Greeter_GetStreamClient interface {
	Recv() (*StreamResData, error)
	grpc.ClientStream
}

type Greeter_GetStreamServer

type Greeter_GetStreamServer interface {
	Send(*StreamResData) error
	grpc.ServerStream
}

type Greeter_PutStreamClient

type Greeter_PutStreamClient interface {
	Send(*StreamReqData) error
	CloseAndRecv() (*StreamResData, error)
	grpc.ClientStream
}

type Greeter_PutStreamServer

type Greeter_PutStreamServer interface {
	SendAndClose(*StreamResData) error
	Recv() (*StreamReqData, error)
	grpc.ServerStream
}

type StreamReqData

type StreamReqData struct {
	Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

stream请求结构

func (*StreamReqData) Descriptor deprecated

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

Deprecated: Use StreamReqData.ProtoReflect.Descriptor instead.

func (*StreamReqData) GetData

func (x *StreamReqData) GetData() string

func (*StreamReqData) ProtoMessage

func (*StreamReqData) ProtoMessage()

func (*StreamReqData) ProtoReflect

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

func (*StreamReqData) Reset

func (x *StreamReqData) Reset()

func (*StreamReqData) String

func (x *StreamReqData) String() string

type StreamResData

type StreamResData struct {
	Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

stream返回结构

func (*StreamResData) Descriptor deprecated

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

Deprecated: Use StreamResData.ProtoReflect.Descriptor instead.

func (*StreamResData) GetData

func (x *StreamResData) GetData() string

func (*StreamResData) ProtoMessage

func (*StreamResData) ProtoMessage()

func (*StreamResData) ProtoReflect

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

func (*StreamResData) Reset

func (x *StreamResData) Reset()

func (*StreamResData) String

func (x *StreamResData) String() string

type UnimplementedGreeterServer

type UnimplementedGreeterServer struct {
}

UnimplementedGreeterServer must be embedded to have forward compatible implementations.

func (UnimplementedGreeterServer) AllStream

func (UnimplementedGreeterServer) GetStream

func (UnimplementedGreeterServer) PutStream

type UnsafeGreeterServer

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

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

Jump to

Keyboard shortcuts

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