Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterHelloServiceServer(s grpc.ServiceRegistrar, srv HelloServiceServer)
- func RegisterPingServiceServer(s grpc.ServiceRegistrar, srv PingServiceServer)
- type HelloRequest
- type HelloRequestWithField
- func (*HelloRequestWithField) Descriptor() ([]byte, []int)deprecated
- func (x *HelloRequestWithField) GetName() string
- func (*HelloRequestWithField) ProtoMessage()
- func (x *HelloRequestWithField) ProtoReflect() protoreflect.Message
- func (x *HelloRequestWithField) Reset()
- func (x *HelloRequestWithField) String() string
- type HelloResponse
- func (*HelloResponse) Descriptor() ([]byte, []int)deprecated
- func (x *HelloResponse) GetError() *status.Status
- func (x *HelloResponse) GetMessage() string
- func (m *HelloResponse) GetResult() isHelloResponse_Result
- func (*HelloResponse) ProtoMessage()
- func (x *HelloResponse) ProtoReflect() protoreflect.Message
- func (x *HelloResponse) Reset()
- func (x *HelloResponse) String() string
- type HelloResponse_Error
- type HelloResponse_Message
- type HelloServiceClient
- type HelloServiceServer
- type PingRequest
- type PingResponse
- func (*PingResponse) Descriptor() ([]byte, []int)deprecated
- func (x *PingResponse) GetFormattedLatency() string
- func (x *PingResponse) GetFormattedLatencyMilliseconds() string
- func (x *PingResponse) GetLatencyMicroseconds() int64
- func (*PingResponse) ProtoMessage()
- func (x *PingResponse) ProtoReflect() protoreflect.Message
- func (x *PingResponse) Reset()
- func (x *PingResponse) String() string
- type PingServiceClient
- type PingServiceServer
- type UnimplementedHelloServiceServer
- type UnimplementedPingServiceServer
- type UnsafeHelloServiceServer
- type UnsafePingServiceServer
Constants ¶
const ( HelloService_SayHello_FullMethodName = "/redirect.HelloService/SayHello" HelloService_SayHelloWithField_FullMethodName = "/redirect.HelloService/SayHelloWithField" )
const (
PingService_Ping_FullMethodName = "/redirect.PingService/Ping"
)
Variables ¶
var File_handler_hello_world_proto protoreflect.FileDescriptor
var HelloService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "redirect.HelloService", HandlerType: (*HelloServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SayHello", Handler: _HelloService_SayHello_Handler, }, { MethodName: "SayHelloWithField", Handler: _HelloService_SayHelloWithField_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "handler/hello_world.proto", }
HelloService_ServiceDesc is the grpc.ServiceDesc for HelloService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var PingService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "redirect.PingService", HandlerType: (*PingServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Ping", Handler: _PingService_Ping_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "handler/hello_world.proto", }
PingService_ServiceDesc is the grpc.ServiceDesc for PingService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterHelloServiceServer ¶
func RegisterHelloServiceServer(s grpc.ServiceRegistrar, srv HelloServiceServer)
func RegisterPingServiceServer ¶
func RegisterPingServiceServer(s grpc.ServiceRegistrar, srv PingServiceServer)
Types ¶
type HelloRequest ¶
type HelloRequest struct {
// contains filtered or unexported fields
}
HelloRequest is the request for a generic greeting.
func (*HelloRequest) Descriptor
deprecated
func (*HelloRequest) Descriptor() ([]byte, []int)
Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.
func (*HelloRequest) ProtoMessage ¶
func (*HelloRequest) ProtoMessage()
func (*HelloRequest) ProtoReflect ¶
func (x *HelloRequest) ProtoReflect() protoreflect.Message
func (*HelloRequest) Reset ¶
func (x *HelloRequest) Reset()
func (*HelloRequest) String ¶
func (x *HelloRequest) String() string
type HelloRequestWithField ¶
type HelloRequestWithField struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The name of the person to greet. // contains filtered or unexported fields }
HelloRequestWithField includes a name for personalized greetings.
func (*HelloRequestWithField) Descriptor
deprecated
func (*HelloRequestWithField) Descriptor() ([]byte, []int)
Deprecated: Use HelloRequestWithField.ProtoReflect.Descriptor instead.
func (*HelloRequestWithField) GetName ¶
func (x *HelloRequestWithField) GetName() string
func (*HelloRequestWithField) ProtoMessage ¶
func (*HelloRequestWithField) ProtoMessage()
func (*HelloRequestWithField) ProtoReflect ¶
func (x *HelloRequestWithField) ProtoReflect() protoreflect.Message
func (*HelloRequestWithField) Reset ¶
func (x *HelloRequestWithField) Reset()
func (*HelloRequestWithField) String ¶
func (x *HelloRequestWithField) String() string
type HelloResponse ¶
type HelloResponse struct { // Types that are assignable to Result: // // *HelloResponse_Message // *HelloResponse_Error Result isHelloResponse_Result `protobuf_oneof:"result"` // contains filtered or unexported fields }
HelloResponse contains either a greeting message or an error.
func (*HelloResponse) Descriptor
deprecated
func (*HelloResponse) Descriptor() ([]byte, []int)
Deprecated: Use HelloResponse.ProtoReflect.Descriptor instead.
func (*HelloResponse) GetError ¶
func (x *HelloResponse) GetError() *status.Status
func (*HelloResponse) GetMessage ¶
func (x *HelloResponse) GetMessage() string
func (*HelloResponse) GetResult ¶
func (m *HelloResponse) GetResult() isHelloResponse_Result
func (*HelloResponse) ProtoMessage ¶
func (*HelloResponse) ProtoMessage()
func (*HelloResponse) ProtoReflect ¶
func (x *HelloResponse) ProtoReflect() protoreflect.Message
func (*HelloResponse) Reset ¶
func (x *HelloResponse) Reset()
func (*HelloResponse) String ¶
func (x *HelloResponse) String() string
type HelloResponse_Error ¶
type HelloResponse_Message ¶
type HelloResponse_Message struct {
Message string `protobuf:"bytes,1,opt,name=message,proto3,oneof"` // The greeting message on success.
}
type HelloServiceClient ¶
type HelloServiceClient interface { // SayHello returns a generic greeting. SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error) // SayHelloWithField returns a personalized greeting using the provided name. SayHelloWithField(ctx context.Context, in *HelloRequestWithField, opts ...grpc.CallOption) (*HelloResponse, error) }
HelloServiceClient is the client API for HelloService 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 NewHelloServiceClient ¶
func NewHelloServiceClient(cc grpc.ClientConnInterface) HelloServiceClient
type HelloServiceServer ¶
type HelloServiceServer interface { // SayHello returns a generic greeting. SayHello(context.Context, *HelloRequest) (*HelloResponse, error) // SayHelloWithField returns a personalized greeting using the provided name. SayHelloWithField(context.Context, *HelloRequestWithField) (*HelloResponse, error) // contains filtered or unexported methods }
HelloServiceServer is the server API for HelloService service. All implementations must embed UnimplementedHelloServiceServer for forward compatibility
type PingRequest ¶
type PingRequest struct {
// contains filtered or unexported fields
}
PingRequest is the request for a latency check.
func (*PingRequest) Descriptor
deprecated
func (*PingRequest) Descriptor() ([]byte, []int)
Deprecated: Use PingRequest.ProtoReflect.Descriptor instead.
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 { // The latency in microseconds. LatencyMicroseconds int64 `protobuf:"varint,1,opt,name=latency_microseconds,json=latencyMicroseconds,proto3" json:"latency_microseconds,omitempty"` // The formatted latency string. FormattedLatency string `protobuf:"bytes,2,opt,name=formatted_latency,json=formattedLatency,proto3" json:"formatted_latency,omitempty"` // The formatted latency string in milliseconds. FormattedLatencyMilliseconds string `` /* 147-byte string literal not displayed */ // contains filtered or unexported fields }
PingResponse contains the latency information.
func (*PingResponse) Descriptor
deprecated
func (*PingResponse) Descriptor() ([]byte, []int)
Deprecated: Use PingResponse.ProtoReflect.Descriptor instead.
func (*PingResponse) GetFormattedLatency ¶
func (x *PingResponse) GetFormattedLatency() string
func (*PingResponse) GetFormattedLatencyMilliseconds ¶
func (x *PingResponse) GetFormattedLatencyMilliseconds() string
func (*PingResponse) GetLatencyMicroseconds ¶
func (x *PingResponse) GetLatencyMicroseconds() int64
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 PingServiceClient ¶
type PingServiceClient interface { // Ping receives a PingRequest and returns a PingResponse // with latency information. Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) }
PingServiceClient is the client API for PingService 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 NewPingServiceClient ¶
func NewPingServiceClient(cc grpc.ClientConnInterface) PingServiceClient
type PingServiceServer ¶
type PingServiceServer interface { // Ping receives a PingRequest and returns a PingResponse // with latency information. Ping(context.Context, *PingRequest) (*PingResponse, error) // contains filtered or unexported methods }
PingServiceServer is the server API for PingService service. All implementations must embed UnimplementedPingServiceServer for forward compatibility
type UnimplementedHelloServiceServer ¶
type UnimplementedHelloServiceServer struct { }
UnimplementedHelloServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedHelloServiceServer) SayHello ¶
func (UnimplementedHelloServiceServer) SayHello(context.Context, *HelloRequest) (*HelloResponse, error)
func (UnimplementedHelloServiceServer) SayHelloWithField ¶
func (UnimplementedHelloServiceServer) SayHelloWithField(context.Context, *HelloRequestWithField) (*HelloResponse, error)
type UnimplementedPingServiceServer ¶
type UnimplementedPingServiceServer struct { }
UnimplementedPingServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedPingServiceServer) Ping ¶
func (UnimplementedPingServiceServer) Ping(context.Context, *PingRequest) (*PingResponse, error)
type UnsafeHelloServiceServer ¶
type UnsafeHelloServiceServer interface {
// contains filtered or unexported methods
}
UnsafeHelloServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to HelloServiceServer will result in compilation errors.
type UnsafePingServiceServer ¶
type UnsafePingServiceServer interface {
// contains filtered or unexported methods
}
UnsafePingServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PingServiceServer will result in compilation errors.