handler

package
v0.0.0-...-10ded6d Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HelloService_SayHello_FullMethodName          = "/redirect.HelloService/SayHello"
	HelloService_SayHelloWithField_FullMethodName = "/redirect.HelloService/SayHelloWithField"
)
View Source
const (
	PingService_Ping_FullMethodName = "/redirect.PingService/Ping"
)

Variables

View Source
var File_handler_hello_world_proto protoreflect.FileDescriptor
View Source
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)

View Source
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_Error struct {
	Error *status.Status `protobuf:"bytes,2,opt,name=error,proto3,oneof"` // The error status on failure.
}

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.

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.

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) SayHelloWithField

type UnimplementedPingServiceServer

type UnimplementedPingServiceServer struct {
}

UnimplementedPingServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedPingServiceServer) Ping

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.

Jump to

Keyboard shortcuts

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