Documentation ¶
Overview ¶
Package hello is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterHelloGreeterHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterHelloGreeterHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HelloGreeterClient) error
- func RegisterHelloGreeterHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterHelloGreeterHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HelloGreeterServer) error
- func RegisterHelloGreeterServer(s grpc.ServiceRegistrar, srv HelloGreeterServer)
- func RegisterHelloIdentityHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterHelloIdentityHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HelloIdentityClient) error
- func RegisterHelloIdentityHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterHelloIdentityHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HelloIdentityServer) error
- func RegisterHelloIdentityServer(s grpc.ServiceRegistrar, srv HelloIdentityServer)
- type HelloGreeterClient
- type HelloGreeterSayHelloRequest
- func (*HelloGreeterSayHelloRequest) Descriptor() ([]byte, []int)deprecated
- func (x *HelloGreeterSayHelloRequest) GetName() string
- func (*HelloGreeterSayHelloRequest) ProtoMessage()
- func (x *HelloGreeterSayHelloRequest) ProtoReflect() protoreflect.Message
- func (x *HelloGreeterSayHelloRequest) Reset()
- func (x *HelloGreeterSayHelloRequest) String() string
- type HelloGreeterSayHelloResponse
- func (*HelloGreeterSayHelloResponse) Descriptor() ([]byte, []int)deprecated
- func (x *HelloGreeterSayHelloResponse) GetMessage() string
- func (*HelloGreeterSayHelloResponse) ProtoMessage()
- func (x *HelloGreeterSayHelloResponse) ProtoReflect() protoreflect.Message
- func (x *HelloGreeterSayHelloResponse) Reset()
- func (x *HelloGreeterSayHelloResponse) String() string
- type HelloGreeterServer
- type HelloIdentityClient
- type HelloIdentityServer
- type HelloIdentityVersionRequest
- type HelloIdentityVersionResponse
- func (*HelloIdentityVersionResponse) Descriptor() ([]byte, []int)deprecated
- func (x *HelloIdentityVersionResponse) GetServerVersion() *HelloVersion
- func (*HelloIdentityVersionResponse) ProtoMessage()
- func (x *HelloIdentityVersionResponse) ProtoReflect() protoreflect.Message
- func (x *HelloIdentityVersionResponse) Reset()
- func (x *HelloIdentityVersionResponse) String() string
- type HelloVersion
- func (*HelloVersion) Descriptor() ([]byte, []int)deprecated
- func (x *HelloVersion) GetMajor() int32
- func (x *HelloVersion) GetMinor() int32
- func (x *HelloVersion) GetPatch() int32
- func (x *HelloVersion) GetVersion() string
- func (*HelloVersion) ProtoMessage()
- func (x *HelloVersion) ProtoReflect() protoreflect.Message
- func (x *HelloVersion) Reset()
- func (x *HelloVersion) String() string
- type HelloVersion_Version
- func (HelloVersion_Version) Descriptor() protoreflect.EnumDescriptor
- func (x HelloVersion_Version) Enum() *HelloVersion_Version
- func (HelloVersion_Version) EnumDescriptor() ([]byte, []int)deprecated
- func (x HelloVersion_Version) Number() protoreflect.EnumNumber
- func (x HelloVersion_Version) String() string
- func (HelloVersion_Version) Type() protoreflect.EnumType
- type UnimplementedHelloGreeterServer
- type UnimplementedHelloIdentityServer
- type UnsafeHelloGreeterServer
- type UnsafeHelloIdentityServer
Constants ¶
const (
HelloGreeter_SayHello_FullMethodName = "/hello.hello.v1.HelloGreeter/SayHello"
)
const (
HelloIdentity_ServerVersion_FullMethodName = "/hello.hello.v1.HelloIdentity/ServerVersion"
)
Variables ¶
var ( HelloVersion_Version_name = map[int32]string{ 0: "VERSION_UNSPECIFIED", 1: "PATCH", } HelloVersion_Version_value = map[string]int32{ "VERSION_UNSPECIFIED": 0, "MAJOR": 0, "MINOR": 0, "PATCH": 1, } )
Enum value maps for HelloVersion_Version.
var File_apis_hello_apiv1_hello_proto protoreflect.FileDescriptor
var HelloGreeter_ServiceDesc = grpc.ServiceDesc{ ServiceName: "hello.hello.v1.HelloGreeter", HandlerType: (*HelloGreeterServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SayHello", Handler: _HelloGreeter_SayHello_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "apis/hello/apiv1/hello.proto", }
HelloGreeter_ServiceDesc is the grpc.ServiceDesc for HelloGreeter service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var HelloIdentity_ServiceDesc = grpc.ServiceDesc{ ServiceName: "hello.hello.v1.HelloIdentity", HandlerType: (*HelloIdentityServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ServerVersion", Handler: _HelloIdentity_ServerVersion_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "apis/hello/apiv1/hello.proto", }
HelloIdentity_ServiceDesc is the grpc.ServiceDesc for HelloIdentity service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterHelloGreeterHandler ¶
func RegisterHelloGreeterHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterHelloGreeterHandler registers the http handlers for service HelloGreeter to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterHelloGreeterHandlerClient ¶
func RegisterHelloGreeterHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HelloGreeterClient) error
RegisterHelloGreeterHandlerClient registers the http handlers for service HelloGreeter to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "HelloGreeterClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "HelloGreeterClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "HelloGreeterClient" to call the correct interceptors.
func RegisterHelloGreeterHandlerFromEndpoint ¶
func RegisterHelloGreeterHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterHelloGreeterHandlerFromEndpoint is same as RegisterHelloGreeterHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterHelloGreeterHandlerServer ¶
func RegisterHelloGreeterHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HelloGreeterServer) error
RegisterHelloGreeterHandlerServer registers the http handlers for service HelloGreeter to "mux". UnaryRPC :call HelloGreeterServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterHelloGreeterHandlerFromEndpoint instead.
func RegisterHelloGreeterServer ¶
func RegisterHelloGreeterServer(s grpc.ServiceRegistrar, srv HelloGreeterServer)
func RegisterHelloIdentityHandler ¶
func RegisterHelloIdentityHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterHelloIdentityHandler registers the http handlers for service HelloIdentity to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterHelloIdentityHandlerClient ¶
func RegisterHelloIdentityHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HelloIdentityClient) error
RegisterHelloIdentityHandlerClient registers the http handlers for service HelloIdentity to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "HelloIdentityClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "HelloIdentityClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "HelloIdentityClient" to call the correct interceptors.
func RegisterHelloIdentityHandlerFromEndpoint ¶
func RegisterHelloIdentityHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterHelloIdentityHandlerFromEndpoint is same as RegisterHelloIdentityHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterHelloIdentityHandlerServer ¶
func RegisterHelloIdentityHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HelloIdentityServer) error
RegisterHelloIdentityHandlerServer registers the http handlers for service HelloIdentity to "mux". UnaryRPC :call HelloIdentityServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterHelloIdentityHandlerFromEndpoint instead.
func RegisterHelloIdentityServer ¶
func RegisterHelloIdentityServer(s grpc.ServiceRegistrar, srv HelloIdentityServer)
Types ¶
type HelloGreeterClient ¶
type HelloGreeterClient interface { // Sends a greeting SayHello(ctx context.Context, in *HelloGreeterSayHelloRequest, opts ...grpc.CallOption) (*HelloGreeterSayHelloResponse, error) }
HelloGreeterClient is the client API for HelloGreeter 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 NewHelloGreeterClient ¶
func NewHelloGreeterClient(cc grpc.ClientConnInterface) HelloGreeterClient
type HelloGreeterSayHelloRequest ¶
type HelloGreeterSayHelloRequest struct { // Name to say hello to Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
The request message containing the user's name.
func (*HelloGreeterSayHelloRequest) Descriptor
deprecated
func (*HelloGreeterSayHelloRequest) Descriptor() ([]byte, []int)
Deprecated: Use HelloGreeterSayHelloRequest.ProtoReflect.Descriptor instead.
func (*HelloGreeterSayHelloRequest) GetName ¶
func (x *HelloGreeterSayHelloRequest) GetName() string
func (*HelloGreeterSayHelloRequest) ProtoMessage ¶
func (*HelloGreeterSayHelloRequest) ProtoMessage()
func (*HelloGreeterSayHelloRequest) ProtoReflect ¶
func (x *HelloGreeterSayHelloRequest) ProtoReflect() protoreflect.Message
func (*HelloGreeterSayHelloRequest) Reset ¶
func (x *HelloGreeterSayHelloRequest) Reset()
func (*HelloGreeterSayHelloRequest) String ¶
func (x *HelloGreeterSayHelloRequest) String() string
type HelloGreeterSayHelloResponse ¶
type HelloGreeterSayHelloResponse struct { // Message returned from server containing 'name' Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
The response message containing the greetings
func (*HelloGreeterSayHelloResponse) Descriptor
deprecated
func (*HelloGreeterSayHelloResponse) Descriptor() ([]byte, []int)
Deprecated: Use HelloGreeterSayHelloResponse.ProtoReflect.Descriptor instead.
func (*HelloGreeterSayHelloResponse) GetMessage ¶
func (x *HelloGreeterSayHelloResponse) GetMessage() string
func (*HelloGreeterSayHelloResponse) ProtoMessage ¶
func (*HelloGreeterSayHelloResponse) ProtoMessage()
func (*HelloGreeterSayHelloResponse) ProtoReflect ¶
func (x *HelloGreeterSayHelloResponse) ProtoReflect() protoreflect.Message
func (*HelloGreeterSayHelloResponse) Reset ¶
func (x *HelloGreeterSayHelloResponse) Reset()
func (*HelloGreeterSayHelloResponse) String ¶
func (x *HelloGreeterSayHelloResponse) String() string
type HelloGreeterServer ¶
type HelloGreeterServer interface { // Sends a greeting SayHello(context.Context, *HelloGreeterSayHelloRequest) (*HelloGreeterSayHelloResponse, error) // contains filtered or unexported methods }
HelloGreeterServer is the server API for HelloGreeter service. All implementations must embed UnimplementedHelloGreeterServer for forward compatibility
type HelloIdentityClient ¶
type HelloIdentityClient interface { // Gets server version ServerVersion(ctx context.Context, in *HelloIdentityVersionRequest, opts ...grpc.CallOption) (*HelloIdentityVersionResponse, error) }
HelloIdentityClient is the client API for HelloIdentity 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 NewHelloIdentityClient ¶
func NewHelloIdentityClient(cc grpc.ClientConnInterface) HelloIdentityClient
type HelloIdentityServer ¶
type HelloIdentityServer interface { // Gets server version ServerVersion(context.Context, *HelloIdentityVersionRequest) (*HelloIdentityVersionResponse, error) // contains filtered or unexported methods }
HelloIdentityServer is the server API for HelloIdentity service. All implementations must embed UnimplementedHelloIdentityServer for forward compatibility
type HelloIdentityVersionRequest ¶
type HelloIdentityVersionRequest struct {
// contains filtered or unexported fields
}
Empty request
func (*HelloIdentityVersionRequest) Descriptor
deprecated
func (*HelloIdentityVersionRequest) Descriptor() ([]byte, []int)
Deprecated: Use HelloIdentityVersionRequest.ProtoReflect.Descriptor instead.
func (*HelloIdentityVersionRequest) ProtoMessage ¶
func (*HelloIdentityVersionRequest) ProtoMessage()
func (*HelloIdentityVersionRequest) ProtoReflect ¶
func (x *HelloIdentityVersionRequest) ProtoReflect() protoreflect.Message
func (*HelloIdentityVersionRequest) Reset ¶
func (x *HelloIdentityVersionRequest) Reset()
func (*HelloIdentityVersionRequest) String ¶
func (x *HelloIdentityVersionRequest) String() string
type HelloIdentityVersionResponse ¶
type HelloIdentityVersionResponse struct { // Hello application version ServerVersion *HelloVersion `protobuf:"bytes,1,opt,name=server_version,json=serverVersion,proto3" json:"server_version,omitempty"` // contains filtered or unexported fields }
Defines the response to version
func (*HelloIdentityVersionResponse) Descriptor
deprecated
func (*HelloIdentityVersionResponse) Descriptor() ([]byte, []int)
Deprecated: Use HelloIdentityVersionResponse.ProtoReflect.Descriptor instead.
func (*HelloIdentityVersionResponse) GetServerVersion ¶
func (x *HelloIdentityVersionResponse) GetServerVersion() *HelloVersion
func (*HelloIdentityVersionResponse) ProtoMessage ¶
func (*HelloIdentityVersionResponse) ProtoMessage()
func (*HelloIdentityVersionResponse) ProtoReflect ¶
func (x *HelloIdentityVersionResponse) ProtoReflect() protoreflect.Message
func (*HelloIdentityVersionResponse) Reset ¶
func (x *HelloIdentityVersionResponse) Reset()
func (*HelloIdentityVersionResponse) String ¶
func (x *HelloIdentityVersionResponse) String() string
type HelloVersion ¶
type HelloVersion struct { // Version major number Major int32 `protobuf:"varint,1,opt,name=major,proto3" json:"major,omitempty"` // Version minor number Minor int32 `protobuf:"varint,2,opt,name=minor,proto3" json:"minor,omitempty"` // Version patch number Patch int32 `protobuf:"varint,3,opt,name=patch,proto3" json:"patch,omitempty"` // String representation of the version. Must be // in `major.minor.patch` format. Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` // contains filtered or unexported fields }
Hello version in Major.Minor.Patch format. The goal of this message is to provide clients a method to determine the server and client versions.
func (*HelloVersion) Descriptor
deprecated
func (*HelloVersion) Descriptor() ([]byte, []int)
Deprecated: Use HelloVersion.ProtoReflect.Descriptor instead.
func (*HelloVersion) GetMajor ¶
func (x *HelloVersion) GetMajor() int32
func (*HelloVersion) GetMinor ¶
func (x *HelloVersion) GetMinor() int32
func (*HelloVersion) GetPatch ¶
func (x *HelloVersion) GetPatch() int32
func (*HelloVersion) GetVersion ¶
func (x *HelloVersion) GetVersion() string
func (*HelloVersion) ProtoMessage ¶
func (*HelloVersion) ProtoMessage()
func (*HelloVersion) ProtoReflect ¶
func (x *HelloVersion) ProtoReflect() protoreflect.Message
func (*HelloVersion) Reset ¶
func (x *HelloVersion) Reset()
func (*HelloVersion) String ¶
func (x *HelloVersion) String() string
type HelloVersion_Version ¶
type HelloVersion_Version int32
These values are constants that can be used by the client and server applications
const ( // Must be set in the proto file; ignore. HelloVersion_VERSION_UNSPECIFIED HelloVersion_Version = 0 // Version major value of this specification HelloVersion_MAJOR HelloVersion_Version = 0 // Version minor value of this specification HelloVersion_MINOR HelloVersion_Version = 0 // Version patch value of this specification HelloVersion_PATCH HelloVersion_Version = 1 )
func (HelloVersion_Version) Descriptor ¶
func (HelloVersion_Version) Descriptor() protoreflect.EnumDescriptor
func (HelloVersion_Version) Enum ¶
func (x HelloVersion_Version) Enum() *HelloVersion_Version
func (HelloVersion_Version) EnumDescriptor
deprecated
func (HelloVersion_Version) EnumDescriptor() ([]byte, []int)
Deprecated: Use HelloVersion_Version.Descriptor instead.
func (HelloVersion_Version) Number ¶
func (x HelloVersion_Version) Number() protoreflect.EnumNumber
func (HelloVersion_Version) String ¶
func (x HelloVersion_Version) String() string
func (HelloVersion_Version) Type ¶
func (HelloVersion_Version) Type() protoreflect.EnumType
type UnimplementedHelloGreeterServer ¶
type UnimplementedHelloGreeterServer struct { }
UnimplementedHelloGreeterServer must be embedded to have forward compatible implementations.
func (UnimplementedHelloGreeterServer) SayHello ¶
func (UnimplementedHelloGreeterServer) SayHello(context.Context, *HelloGreeterSayHelloRequest) (*HelloGreeterSayHelloResponse, error)
type UnimplementedHelloIdentityServer ¶
type UnimplementedHelloIdentityServer struct { }
UnimplementedHelloIdentityServer must be embedded to have forward compatible implementations.
func (UnimplementedHelloIdentityServer) ServerVersion ¶
func (UnimplementedHelloIdentityServer) ServerVersion(context.Context, *HelloIdentityVersionRequest) (*HelloIdentityVersionResponse, error)
type UnsafeHelloGreeterServer ¶
type UnsafeHelloGreeterServer interface {
// contains filtered or unexported methods
}
UnsafeHelloGreeterServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to HelloGreeterServer will result in compilation errors.
type UnsafeHelloIdentityServer ¶
type UnsafeHelloIdentityServer interface {
// contains filtered or unexported methods
}
UnsafeHelloIdentityServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to HelloIdentityServer will result in compilation errors.