Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterGreeterServiceHTTPServer(s *http.Server, srv GreeterServiceHTTPServer)
- func RegisterGreeterServiceServer(s grpc.ServiceRegistrar, srv GreeterServiceServer)
- type ErrorReason
- func (ErrorReason) Descriptor() protoreflect.EnumDescriptor
- func (x ErrorReason) Enum() *ErrorReason
- func (ErrorReason) EnumDescriptor() ([]byte, []int)deprecated
- func (x ErrorReason) Number() protoreflect.EnumNumber
- func (x ErrorReason) String() string
- func (ErrorReason) Type() protoreflect.EnumType
- type GreeterServiceClient
- type GreeterServiceHTTPClient
- type GreeterServiceHTTPClientImpl
- type GreeterServiceHTTPServer
- type GreeterServiceServer
- type LuckySearchRequest
- func (*LuckySearchRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LuckySearchRequest) GetKeyword() string
- func (*LuckySearchRequest) ProtoMessage()
- func (x *LuckySearchRequest) ProtoReflect() protoreflect.Message
- func (x *LuckySearchRequest) Reset()
- func (x *LuckySearchRequest) String() string
- func (m *LuckySearchRequest) Validate() error
- func (m *LuckySearchRequest) ValidateAll() error
- type LuckySearchRequestMultiError
- type LuckySearchRequestValidationError
- func (e LuckySearchRequestValidationError) Cause() error
- func (e LuckySearchRequestValidationError) Error() string
- func (e LuckySearchRequestValidationError) ErrorName() string
- func (e LuckySearchRequestValidationError) Field() string
- func (e LuckySearchRequestValidationError) Key() bool
- func (e LuckySearchRequestValidationError) Reason() string
- type LuckySearchResponse
- func (*LuckySearchResponse) Descriptor() ([]byte, []int)deprecated
- func (x *LuckySearchResponse) GetRedirectTo() string
- func (x *LuckySearchResponse) GetStatusCode() int32
- func (*LuckySearchResponse) ProtoMessage()
- func (x *LuckySearchResponse) ProtoReflect() protoreflect.Message
- func (s *LuckySearchResponse) Redirect() (string, int)
- func (x *LuckySearchResponse) Reset()
- func (x *LuckySearchResponse) String() string
- func (m *LuckySearchResponse) Validate() error
- func (m *LuckySearchResponse) ValidateAll() error
- type LuckySearchResponseMultiError
- type LuckySearchResponseValidationError
- func (e LuckySearchResponseValidationError) Cause() error
- func (e LuckySearchResponseValidationError) Error() string
- func (e LuckySearchResponseValidationError) ErrorName() string
- func (e LuckySearchResponseValidationError) Field() string
- func (e LuckySearchResponseValidationError) Key() bool
- func (e LuckySearchResponseValidationError) Reason() string
- type SayHelloRequest
- func (*SayHelloRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SayHelloRequest) GetName() string
- func (*SayHelloRequest) ProtoMessage()
- func (x *SayHelloRequest) ProtoReflect() protoreflect.Message
- func (x *SayHelloRequest) Reset()
- func (x *SayHelloRequest) String() string
- func (m *SayHelloRequest) Validate() error
- func (m *SayHelloRequest) ValidateAll() error
- type SayHelloRequestMultiError
- type SayHelloRequestValidationError
- func (e SayHelloRequestValidationError) Cause() error
- func (e SayHelloRequestValidationError) Error() string
- func (e SayHelloRequestValidationError) ErrorName() string
- func (e SayHelloRequestValidationError) Field() string
- func (e SayHelloRequestValidationError) Key() bool
- func (e SayHelloRequestValidationError) Reason() string
- type SayHelloResponse
- func (*SayHelloResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SayHelloResponse) GetMessage() string
- func (*SayHelloResponse) ProtoMessage()
- func (x *SayHelloResponse) ProtoReflect() protoreflect.Message
- func (x *SayHelloResponse) Reset()
- func (x *SayHelloResponse) String() string
- func (m *SayHelloResponse) Validate() error
- func (m *SayHelloResponse) ValidateAll() error
- type SayHelloResponseMultiError
- type SayHelloResponseValidationError
- func (e SayHelloResponseValidationError) Cause() error
- func (e SayHelloResponseValidationError) Error() string
- func (e SayHelloResponseValidationError) ErrorName() string
- func (e SayHelloResponseValidationError) Field() string
- func (e SayHelloResponseValidationError) Key() bool
- func (e SayHelloResponseValidationError) Reason() string
- type UnimplementedGreeterServiceServer
- type UnsafeGreeterServiceServer
Constants ¶
const ( GreeterService_SayHello_FullMethodName = "/helloworld.v1.GreeterService/SayHello" GreeterService_LuckySearch_FullMethodName = "/helloworld.v1.GreeterService/LuckySearch" )
const OperationGreeterServiceLuckySearch = "/helloworld.v1.GreeterService/LuckySearch"
const OperationGreeterServiceSayHello = "/helloworld.v1.GreeterService/SayHello"
Variables ¶
var ( ErrorReason_name = map[int32]string{ 0: "GREETER_UNSPECIFIED", 1: "USER_NOT_FOUND", } ErrorReason_value = map[string]int32{ "GREETER_UNSPECIFIED": 0, "USER_NOT_FOUND": 1, } )
Enum value maps for ErrorReason.
var File_helloworld_v1_error_reason_proto protoreflect.FileDescriptor
var File_helloworld_v1_greeter_proto protoreflect.FileDescriptor
var GreeterService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "helloworld.v1.GreeterService", HandlerType: (*GreeterServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SayHello", Handler: _GreeterService_SayHello_Handler, }, { MethodName: "LuckySearch", Handler: _GreeterService_LuckySearch_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "helloworld/v1/greeter.proto", }
GreeterService_ServiceDesc is the grpc.ServiceDesc for GreeterService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterGreeterServiceHTTPServer ¶
func RegisterGreeterServiceHTTPServer(s *http.Server, srv GreeterServiceHTTPServer)
func RegisterGreeterServiceServer ¶
func RegisterGreeterServiceServer(s grpc.ServiceRegistrar, srv GreeterServiceServer)
Types ¶
type ErrorReason ¶
type ErrorReason int32
const ( ErrorReason_GREETER_UNSPECIFIED ErrorReason = 0 ErrorReason_USER_NOT_FOUND ErrorReason = 1 )
func (ErrorReason) Descriptor ¶
func (ErrorReason) Descriptor() protoreflect.EnumDescriptor
func (ErrorReason) Enum ¶
func (x ErrorReason) Enum() *ErrorReason
func (ErrorReason) EnumDescriptor
deprecated
func (ErrorReason) EnumDescriptor() ([]byte, []int)
Deprecated: Use ErrorReason.Descriptor instead.
func (ErrorReason) Number ¶
func (x ErrorReason) Number() protoreflect.EnumNumber
func (ErrorReason) String ¶
func (x ErrorReason) String() string
func (ErrorReason) Type ¶
func (ErrorReason) Type() protoreflect.EnumType
type GreeterServiceClient ¶
type GreeterServiceClient interface { // Sends a greeting SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) // Simple Google search by Redirect with keywords LuckySearch(ctx context.Context, in *LuckySearchRequest, opts ...grpc.CallOption) (*LuckySearchResponse, error) }
GreeterServiceClient is the client API for GreeterService 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.
The greeting service definition.
func NewGreeterServiceClient ¶
func NewGreeterServiceClient(cc grpc.ClientConnInterface) GreeterServiceClient
type GreeterServiceHTTPClient ¶
type GreeterServiceHTTPClient interface { LuckySearch(ctx context.Context, req *LuckySearchRequest, opts ...http.CallOption) (rsp *LuckySearchResponse, err error) SayHello(ctx context.Context, req *SayHelloRequest, opts ...http.CallOption) (rsp *SayHelloResponse, err error) }
func NewGreeterServiceHTTPClient ¶
func NewGreeterServiceHTTPClient(client *http.Client) GreeterServiceHTTPClient
type GreeterServiceHTTPClientImpl ¶
type GreeterServiceHTTPClientImpl struct {
// contains filtered or unexported fields
}
func (*GreeterServiceHTTPClientImpl) LuckySearch ¶
func (c *GreeterServiceHTTPClientImpl) LuckySearch(ctx context.Context, in *LuckySearchRequest, opts ...http.CallOption) (*LuckySearchResponse, error)
func (*GreeterServiceHTTPClientImpl) SayHello ¶
func (c *GreeterServiceHTTPClientImpl) SayHello(ctx context.Context, in *SayHelloRequest, opts ...http.CallOption) (*SayHelloResponse, error)
type GreeterServiceHTTPServer ¶
type GreeterServiceHTTPServer interface { // LuckySearch Simple Google search by Redirect with keywords LuckySearch(context.Context, *LuckySearchRequest) (*LuckySearchResponse, error) // SayHello Sends a greeting SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error) }
type GreeterServiceServer ¶
type GreeterServiceServer interface { // Sends a greeting SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error) // Simple Google search by Redirect with keywords LuckySearch(context.Context, *LuckySearchRequest) (*LuckySearchResponse, error) }
GreeterServiceServer is the server API for GreeterService service. All implementations should embed UnimplementedGreeterServiceServer for forward compatibility.
The greeting service definition.
type LuckySearchRequest ¶
type LuckySearchRequest struct { Keyword string `protobuf:"bytes,1,opt,name=keyword,proto3" json:"keyword,omitempty"` // contains filtered or unexported fields }
the request message containing the search keywords for search
func (*LuckySearchRequest) Descriptor
deprecated
func (*LuckySearchRequest) Descriptor() ([]byte, []int)
Deprecated: Use LuckySearchRequest.ProtoReflect.Descriptor instead.
func (*LuckySearchRequest) GetKeyword ¶
func (x *LuckySearchRequest) GetKeyword() string
func (*LuckySearchRequest) ProtoMessage ¶
func (*LuckySearchRequest) ProtoMessage()
func (*LuckySearchRequest) ProtoReflect ¶
func (x *LuckySearchRequest) ProtoReflect() protoreflect.Message
func (*LuckySearchRequest) Reset ¶
func (x *LuckySearchRequest) Reset()
func (*LuckySearchRequest) String ¶
func (x *LuckySearchRequest) String() string
func (*LuckySearchRequest) Validate ¶
func (m *LuckySearchRequest) Validate() error
Validate checks the field values on LuckySearchRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*LuckySearchRequest) ValidateAll ¶
func (m *LuckySearchRequest) ValidateAll() error
ValidateAll checks the field values on LuckySearchRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in LuckySearchRequestMultiError, or nil if none found.
type LuckySearchRequestMultiError ¶
type LuckySearchRequestMultiError []error
LuckySearchRequestMultiError is an error wrapping multiple validation errors returned by LuckySearchRequest.ValidateAll() if the designated constraints aren't met.
func (LuckySearchRequestMultiError) AllErrors ¶
func (m LuckySearchRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (LuckySearchRequestMultiError) Error ¶
func (m LuckySearchRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type LuckySearchRequestValidationError ¶
type LuckySearchRequestValidationError struct {
// contains filtered or unexported fields
}
LuckySearchRequestValidationError is the validation error returned by LuckySearchRequest.Validate if the designated constraints aren't met.
func (LuckySearchRequestValidationError) Cause ¶
func (e LuckySearchRequestValidationError) Cause() error
Cause function returns cause value.
func (LuckySearchRequestValidationError) Error ¶
func (e LuckySearchRequestValidationError) Error() string
Error satisfies the builtin error interface
func (LuckySearchRequestValidationError) ErrorName ¶
func (e LuckySearchRequestValidationError) ErrorName() string
ErrorName returns error name.
func (LuckySearchRequestValidationError) Field ¶
func (e LuckySearchRequestValidationError) Field() string
Field function returns field value.
func (LuckySearchRequestValidationError) Key ¶
func (e LuckySearchRequestValidationError) Key() bool
Key function returns key value.
func (LuckySearchRequestValidationError) Reason ¶
func (e LuckySearchRequestValidationError) Reason() string
Reason function returns reason value.
type LuckySearchResponse ¶
type LuckySearchResponse struct { RedirectTo string `protobuf:"bytes,1,opt,name=redirect_to,json=redirectTo,proto3" json:"redirect_to,omitempty"` StatusCode int32 `protobuf:"varint,2,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"` // contains filtered or unexported fields }
The response message containing the target to redirect to and status code
func (*LuckySearchResponse) Descriptor
deprecated
func (*LuckySearchResponse) Descriptor() ([]byte, []int)
Deprecated: Use LuckySearchResponse.ProtoReflect.Descriptor instead.
func (*LuckySearchResponse) GetRedirectTo ¶
func (x *LuckySearchResponse) GetRedirectTo() string
func (*LuckySearchResponse) GetStatusCode ¶
func (x *LuckySearchResponse) GetStatusCode() int32
func (*LuckySearchResponse) ProtoMessage ¶
func (*LuckySearchResponse) ProtoMessage()
func (*LuckySearchResponse) ProtoReflect ¶
func (x *LuckySearchResponse) ProtoReflect() protoreflect.Message
func (*LuckySearchResponse) Redirect ¶
func (s *LuckySearchResponse) Redirect() (string, int)
func (*LuckySearchResponse) Reset ¶
func (x *LuckySearchResponse) Reset()
func (*LuckySearchResponse) String ¶
func (x *LuckySearchResponse) String() string
func (*LuckySearchResponse) Validate ¶
func (m *LuckySearchResponse) Validate() error
Validate checks the field values on LuckySearchResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*LuckySearchResponse) ValidateAll ¶
func (m *LuckySearchResponse) ValidateAll() error
ValidateAll checks the field values on LuckySearchResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in LuckySearchResponseMultiError, or nil if none found.
type LuckySearchResponseMultiError ¶
type LuckySearchResponseMultiError []error
LuckySearchResponseMultiError is an error wrapping multiple validation errors returned by LuckySearchResponse.ValidateAll() if the designated constraints aren't met.
func (LuckySearchResponseMultiError) AllErrors ¶
func (m LuckySearchResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (LuckySearchResponseMultiError) Error ¶
func (m LuckySearchResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type LuckySearchResponseValidationError ¶
type LuckySearchResponseValidationError struct {
// contains filtered or unexported fields
}
LuckySearchResponseValidationError is the validation error returned by LuckySearchResponse.Validate if the designated constraints aren't met.
func (LuckySearchResponseValidationError) Cause ¶
func (e LuckySearchResponseValidationError) Cause() error
Cause function returns cause value.
func (LuckySearchResponseValidationError) Error ¶
func (e LuckySearchResponseValidationError) Error() string
Error satisfies the builtin error interface
func (LuckySearchResponseValidationError) ErrorName ¶
func (e LuckySearchResponseValidationError) ErrorName() string
ErrorName returns error name.
func (LuckySearchResponseValidationError) Field ¶
func (e LuckySearchResponseValidationError) Field() string
Field function returns field value.
func (LuckySearchResponseValidationError) Key ¶
func (e LuckySearchResponseValidationError) Key() bool
Key function returns key value.
func (LuckySearchResponseValidationError) Reason ¶
func (e LuckySearchResponseValidationError) Reason() string
Reason function returns reason value.
type SayHelloRequest ¶
type SayHelloRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // the name to greet // contains filtered or unexported fields }
The request message containing the user's name.
func (*SayHelloRequest) Descriptor
deprecated
func (*SayHelloRequest) Descriptor() ([]byte, []int)
Deprecated: Use SayHelloRequest.ProtoReflect.Descriptor instead.
func (*SayHelloRequest) GetName ¶
func (x *SayHelloRequest) GetName() string
func (*SayHelloRequest) ProtoMessage ¶
func (*SayHelloRequest) ProtoMessage()
func (*SayHelloRequest) ProtoReflect ¶
func (x *SayHelloRequest) ProtoReflect() protoreflect.Message
func (*SayHelloRequest) Reset ¶
func (x *SayHelloRequest) Reset()
func (*SayHelloRequest) String ¶
func (x *SayHelloRequest) String() string
func (*SayHelloRequest) Validate ¶
func (m *SayHelloRequest) Validate() error
Validate checks the field values on SayHelloRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*SayHelloRequest) ValidateAll ¶
func (m *SayHelloRequest) ValidateAll() error
ValidateAll checks the field values on SayHelloRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in SayHelloRequestMultiError, or nil if none found.
type SayHelloRequestMultiError ¶
type SayHelloRequestMultiError []error
SayHelloRequestMultiError is an error wrapping multiple validation errors returned by SayHelloRequest.ValidateAll() if the designated constraints aren't met.
func (SayHelloRequestMultiError) AllErrors ¶
func (m SayHelloRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (SayHelloRequestMultiError) Error ¶
func (m SayHelloRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type SayHelloRequestValidationError ¶
type SayHelloRequestValidationError struct {
// contains filtered or unexported fields
}
SayHelloRequestValidationError is the validation error returned by SayHelloRequest.Validate if the designated constraints aren't met.
func (SayHelloRequestValidationError) Cause ¶
func (e SayHelloRequestValidationError) Cause() error
Cause function returns cause value.
func (SayHelloRequestValidationError) Error ¶
func (e SayHelloRequestValidationError) Error() string
Error satisfies the builtin error interface
func (SayHelloRequestValidationError) ErrorName ¶
func (e SayHelloRequestValidationError) ErrorName() string
ErrorName returns error name.
func (SayHelloRequestValidationError) Field ¶
func (e SayHelloRequestValidationError) Field() string
Field function returns field value.
func (SayHelloRequestValidationError) Key ¶
func (e SayHelloRequestValidationError) Key() bool
Key function returns key value.
func (SayHelloRequestValidationError) Reason ¶
func (e SayHelloRequestValidationError) Reason() string
Reason function returns reason value.
type SayHelloResponse ¶
type SayHelloResponse struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // the message from server // contains filtered or unexported fields }
The response message containing the greetings
func (*SayHelloResponse) Descriptor
deprecated
func (*SayHelloResponse) Descriptor() ([]byte, []int)
Deprecated: Use SayHelloResponse.ProtoReflect.Descriptor instead.
func (*SayHelloResponse) GetMessage ¶
func (x *SayHelloResponse) GetMessage() string
func (*SayHelloResponse) ProtoMessage ¶
func (*SayHelloResponse) ProtoMessage()
func (*SayHelloResponse) ProtoReflect ¶
func (x *SayHelloResponse) ProtoReflect() protoreflect.Message
func (*SayHelloResponse) Reset ¶
func (x *SayHelloResponse) Reset()
func (*SayHelloResponse) String ¶
func (x *SayHelloResponse) String() string
func (*SayHelloResponse) Validate ¶
func (m *SayHelloResponse) Validate() error
Validate checks the field values on SayHelloResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*SayHelloResponse) ValidateAll ¶
func (m *SayHelloResponse) ValidateAll() error
ValidateAll checks the field values on SayHelloResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in SayHelloResponseMultiError, or nil if none found.
type SayHelloResponseMultiError ¶
type SayHelloResponseMultiError []error
SayHelloResponseMultiError is an error wrapping multiple validation errors returned by SayHelloResponse.ValidateAll() if the designated constraints aren't met.
func (SayHelloResponseMultiError) AllErrors ¶
func (m SayHelloResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (SayHelloResponseMultiError) Error ¶
func (m SayHelloResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type SayHelloResponseValidationError ¶
type SayHelloResponseValidationError struct {
// contains filtered or unexported fields
}
SayHelloResponseValidationError is the validation error returned by SayHelloResponse.Validate if the designated constraints aren't met.
func (SayHelloResponseValidationError) Cause ¶
func (e SayHelloResponseValidationError) Cause() error
Cause function returns cause value.
func (SayHelloResponseValidationError) Error ¶
func (e SayHelloResponseValidationError) Error() string
Error satisfies the builtin error interface
func (SayHelloResponseValidationError) ErrorName ¶
func (e SayHelloResponseValidationError) ErrorName() string
ErrorName returns error name.
func (SayHelloResponseValidationError) Field ¶
func (e SayHelloResponseValidationError) Field() string
Field function returns field value.
func (SayHelloResponseValidationError) Key ¶
func (e SayHelloResponseValidationError) Key() bool
Key function returns key value.
func (SayHelloResponseValidationError) Reason ¶
func (e SayHelloResponseValidationError) Reason() string
Reason function returns reason value.
type UnimplementedGreeterServiceServer ¶
type UnimplementedGreeterServiceServer struct{}
UnimplementedGreeterServiceServer should be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedGreeterServiceServer) LuckySearch ¶
func (UnimplementedGreeterServiceServer) LuckySearch(context.Context, *LuckySearchRequest) (*LuckySearchResponse, error)
func (UnimplementedGreeterServiceServer) SayHello ¶
func (UnimplementedGreeterServiceServer) SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error)
type UnsafeGreeterServiceServer ¶
type UnsafeGreeterServiceServer interface {
// contains filtered or unexported methods
}
UnsafeGreeterServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GreeterServiceServer will result in compilation errors.