example

package
v0.0.0-...-8993a07 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExampleGRPCService_Ping_FullMethodName = "/ExampleGRPCService/Ping"
)

Variables

View Source
var ExampleGRPCService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "ExampleGRPCService",
	HandlerType: (*ExampleGRPCServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Ping",
			Handler:    _ExampleGRPCService_Ping_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "web/grpc_example/service.proto",
}

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

View Source
var File_web_grpc_example_service_proto protoreflect.FileDescriptor

Functions

func NewTestService

func NewTestService(name ...string) *testGRPCService

NewTestService it's example package, so we should not care about exports

nolint:revive

func Register

func Register(server *grpc.Server)

Register service on grpc.Server.

func RegisterExampleGRPCServiceServer

func RegisterExampleGRPCServiceServer(s grpc.ServiceRegistrar, srv ExampleGRPCServiceServer)

Types

type ExampleGRPCServiceClient

type ExampleGRPCServiceClient interface {
	Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error)
}

ExampleGRPCServiceClient is the client API for ExampleGRPCService 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.

type ExampleGRPCServiceServer

type ExampleGRPCServiceServer interface {
	Ping(context.Context, *PingRequest) (*PingResponse, error)
	// contains filtered or unexported methods
}

ExampleGRPCServiceServer is the server API for ExampleGRPCService service. All implementations must embed UnimplementedExampleGRPCServiceServer for forward compatibility

type PingRequest

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

func (*PingRequest) Descriptor deprecated

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

Deprecated: Use PingRequest.ProtoReflect.Descriptor instead.

func (*PingRequest) GetName

func (x *PingRequest) GetName() string

func (*PingRequest) ProtoMessage

func (*PingRequest) ProtoMessage()

func (*PingRequest) ProtoReflect

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

func (*PingRequest) Reset

func (x *PingRequest) Reset()

func (*PingRequest) String

func (x *PingRequest) String() string

type PingResponse

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

func (*PingResponse) Descriptor deprecated

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

Deprecated: Use PingResponse.ProtoReflect.Descriptor instead.

func (*PingResponse) GetMessage

func (x *PingResponse) GetMessage() string

func (*PingResponse) ProtoMessage

func (*PingResponse) ProtoMessage()

func (*PingResponse) ProtoReflect

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

func (*PingResponse) Reset

func (x *PingResponse) Reset()

func (*PingResponse) String

func (x *PingResponse) String() string

type UnimplementedExampleGRPCServiceServer

type UnimplementedExampleGRPCServiceServer struct {
}

UnimplementedExampleGRPCServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedExampleGRPCServiceServer) Ping

type UnsafeExampleGRPCServiceServer

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

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

Jump to

Keyboard shortcuts

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