echo

package
v0.0.0-...-74a5474 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

README

Usage

go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
  • Generate protobuf files
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative  *.proto

For how to build server and client code, see server.go and client.go

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EchoServer_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "brpc.test.EchoServer",
	HandlerType: (*EchoServerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Echo",
			Handler:    _EchoServer_Echo_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "echo.proto",
}

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

Functions

func RegisterEchoServerServer

func RegisterEchoServerServer(s grpc.ServiceRegistrar, srv EchoServerServer)

Types

type EchoRequest

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

func (*EchoRequest) Descriptor deprecated

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

Deprecated: Use EchoRequest.ProtoReflect.Descriptor instead.

func (*EchoRequest) GetMessage

func (x *EchoRequest) GetMessage() string

func (*EchoRequest) ProtoMessage

func (*EchoRequest) ProtoMessage()

func (*EchoRequest) ProtoReflect

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

func (*EchoRequest) Reset

func (x *EchoRequest) Reset()

func (*EchoRequest) String

func (x *EchoRequest) String() string

type EchoResponse

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

func (*EchoResponse) Descriptor deprecated

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

Deprecated: Use EchoResponse.ProtoReflect.Descriptor instead.

func (*EchoResponse) GetMessage

func (x *EchoResponse) GetMessage() string

func (*EchoResponse) ProtoMessage

func (*EchoResponse) ProtoMessage()

func (*EchoResponse) ProtoReflect

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

func (*EchoResponse) Reset

func (x *EchoResponse) Reset()

func (*EchoResponse) String

func (x *EchoResponse) String() string

type EchoServerClient

type EchoServerClient interface {
	Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error)
}

EchoServerClient is the client API for EchoServer 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 NewEchoServerClient

func NewEchoServerClient(cc grpc.ClientConnInterface) EchoServerClient

type EchoServerServer

type EchoServerServer interface {
	Echo(context.Context, *EchoRequest) (*EchoResponse, error)
	// contains filtered or unexported methods
}

EchoServerServer is the server API for EchoServer service. All implementations must embed UnimplementedEchoServerServer for forward compatibility

type UnimplementedEchoServerServer

type UnimplementedEchoServerServer struct {
}

UnimplementedEchoServerServer must be embedded to have forward compatible implementations.

func (UnimplementedEchoServerServer) Echo

type UnsafeEchoServerServer

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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