Documentation ¶
Index ¶
- Variables
- func RegisterExampleServiceHTTPServer(s *http.Server, srv ExampleServiceHTTPServer)
- func RegisterExampleServiceServer(s grpc.ServiceRegistrar, srv ExampleServiceServer)
- type ExampleServiceClient
- type ExampleServiceHTTPClient
- type ExampleServiceHTTPClientImpl
- type ExampleServiceHTTPServer
- type ExampleServiceServer
- type Info
- type InfoMultiError
- type InfoValidationError
- type Reply
- type ReplyMultiError
- type ReplyValidationError
- type Request
- func (*Request) Descriptor() ([]byte, []int)deprecated
- func (x *Request) GetAge() int32
- func (x *Request) GetCard() string
- func (x *Request) GetCode() uint32
- func (x *Request) GetExplain() string
- func (x *Request) GetId() int64
- func (x *Request) GetInfo() *Info
- func (x *Request) GetName() string
- func (x *Request) GetPath() string
- func (x *Request) GetPhone() string
- func (x *Request) GetScore() float32
- func (x *Request) GetState() bool
- func (*Request) ProtoMessage()
- func (x *Request) ProtoReflect() protoreflect.Message
- func (x *Request) Reset()
- func (x *Request) String() string
- func (m *Request) Validate() error
- func (m *Request) ValidateAll() error
- type RequestMultiError
- type RequestValidationError
- type UnimplementedExampleServiceServer
- type UnsafeExampleServiceServer
Constants ¶
This section is empty.
Variables ¶
var ExampleService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "api.example.ExampleService", HandlerType: (*ExampleServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "TestValidate", Handler: _ExampleService_TestValidate_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "example.proto", }
ExampleService_ServiceDesc is the grpc.ServiceDesc for ExampleService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_example_proto protoreflect.FileDescriptor
Functions ¶
func RegisterExampleServiceHTTPServer ¶
func RegisterExampleServiceHTTPServer(s *http.Server, srv ExampleServiceHTTPServer)
func RegisterExampleServiceServer ¶
func RegisterExampleServiceServer(s grpc.ServiceRegistrar, srv ExampleServiceServer)
Types ¶
type ExampleServiceClient ¶
type ExampleServiceClient interface {
TestValidate(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Reply, error)
}
ExampleServiceClient is the client API for ExampleService 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 NewExampleServiceClient ¶
func NewExampleServiceClient(cc grpc.ClientConnInterface) ExampleServiceClient
type ExampleServiceHTTPClient ¶
type ExampleServiceHTTPClient interface {
TestValidate(ctx context.Context, req *Request, opts ...http.CallOption) (rsp *Reply, err error)
}
func NewExampleServiceHTTPClient ¶
func NewExampleServiceHTTPClient(client *http.Client) ExampleServiceHTTPClient
type ExampleServiceHTTPClientImpl ¶
type ExampleServiceHTTPClientImpl struct {
// contains filtered or unexported fields
}
func (*ExampleServiceHTTPClientImpl) TestValidate ¶
func (c *ExampleServiceHTTPClientImpl) TestValidate(ctx context.Context, in *Request, opts ...http.CallOption) (*Reply, error)
type ExampleServiceServer ¶
type ExampleServiceServer interface { TestValidate(context.Context, *Request) (*Reply, error) // contains filtered or unexported methods }
ExampleServiceServer is the server API for ExampleService service. All implementations must embed UnimplementedExampleServiceServer for forward compatibility
type Info ¶
type Info struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // contains filtered or unexported fields }
func (*Info) Descriptor
deprecated
func (*Info) GetAddress ¶
func (*Info) ProtoMessage ¶
func (*Info) ProtoMessage()
func (*Info) ProtoReflect ¶
func (x *Info) ProtoReflect() protoreflect.Message
func (*Info) Validate ¶
Validate checks the field values on Info 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 (*Info) ValidateAll ¶
ValidateAll checks the field values on Info 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 InfoMultiError, or nil if none found.
type InfoMultiError ¶
type InfoMultiError []error
InfoMultiError is an error wrapping multiple validation errors returned by Info.ValidateAll() if the designated constraints aren't met.
func (InfoMultiError) AllErrors ¶
func (m InfoMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (InfoMultiError) Error ¶
func (m InfoMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type InfoValidationError ¶
type InfoValidationError struct {
// contains filtered or unexported fields
}
InfoValidationError is the validation error returned by Info.Validate if the designated constraints aren't met.
func (InfoValidationError) Cause ¶
func (e InfoValidationError) Cause() error
Cause function returns cause value.
func (InfoValidationError) Error ¶
func (e InfoValidationError) Error() string
Error satisfies the builtin error interface
func (InfoValidationError) ErrorName ¶
func (e InfoValidationError) ErrorName() string
ErrorName returns error name.
func (InfoValidationError) Field ¶
func (e InfoValidationError) Field() string
Field function returns field value.
func (InfoValidationError) Key ¶
func (e InfoValidationError) Key() bool
Key function returns key value.
func (InfoValidationError) Reason ¶
func (e InfoValidationError) Reason() string
Reason function returns reason value.
type Reply ¶
type Reply struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*Reply) Descriptor
deprecated
func (*Reply) GetMessage ¶
func (*Reply) ProtoMessage ¶
func (*Reply) ProtoMessage()
func (*Reply) ProtoReflect ¶
func (x *Reply) ProtoReflect() protoreflect.Message
func (*Reply) Validate ¶
Validate checks the field values on Reply 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 (*Reply) ValidateAll ¶
ValidateAll checks the field values on Reply 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 ReplyMultiError, or nil if none found.
type ReplyMultiError ¶
type ReplyMultiError []error
ReplyMultiError is an error wrapping multiple validation errors returned by Reply.ValidateAll() if the designated constraints aren't met.
func (ReplyMultiError) AllErrors ¶
func (m ReplyMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ReplyMultiError) Error ¶
func (m ReplyMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ReplyValidationError ¶
type ReplyValidationError struct {
// contains filtered or unexported fields
}
ReplyValidationError is the validation error returned by Reply.Validate if the designated constraints aren't met.
func (ReplyValidationError) Cause ¶
func (e ReplyValidationError) Cause() error
Cause function returns cause value.
func (ReplyValidationError) Error ¶
func (e ReplyValidationError) Error() string
Error satisfies the builtin error interface
func (ReplyValidationError) ErrorName ¶
func (e ReplyValidationError) ErrorName() string
ErrorName returns error name.
func (ReplyValidationError) Field ¶
func (e ReplyValidationError) Field() string
Field function returns field value.
func (ReplyValidationError) Key ¶
func (e ReplyValidationError) Key() bool
Key function returns key value.
func (ReplyValidationError) Reason ¶
func (e ReplyValidationError) Reason() string
Reason function returns reason value.
type Request ¶
type Request struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Age int32 `protobuf:"varint,2,opt,name=age,proto3" json:"age,omitempty"` Code uint32 `protobuf:"varint,3,opt,name=code,proto3" json:"code,omitempty"` Score float32 `protobuf:"fixed32,4,opt,name=score,proto3" json:"score,omitempty"` State bool `protobuf:"varint,5,opt,name=state,proto3" json:"state,omitempty"` Path string `protobuf:"bytes,6,opt,name=path,proto3" json:"path,omitempty"` Phone string `protobuf:"bytes,7,opt,name=phone,proto3" json:"phone,omitempty"` Explain string `protobuf:"bytes,8,opt,name=explain,proto3" json:"explain,omitempty"` Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"` Card string `protobuf:"bytes,10,opt,name=card,proto3" json:"card,omitempty"` Info *Info `protobuf:"bytes,11,opt,name=info,proto3" json:"info,omitempty"` // contains filtered or unexported fields }
func (*Request) Descriptor
deprecated
func (*Request) GetExplain ¶
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) ProtoReflect ¶
func (x *Request) ProtoReflect() protoreflect.Message
func (*Request) Validate ¶
Validate checks the field values on Request 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 (*Request) ValidateAll ¶
ValidateAll checks the field values on Request 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 RequestMultiError, or nil if none found.
type RequestMultiError ¶
type RequestMultiError []error
RequestMultiError is an error wrapping multiple validation errors returned by Request.ValidateAll() if the designated constraints aren't met.
func (RequestMultiError) AllErrors ¶
func (m RequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (RequestMultiError) Error ¶
func (m RequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type RequestValidationError ¶
type RequestValidationError struct {
// contains filtered or unexported fields
}
RequestValidationError is the validation error returned by Request.Validate if the designated constraints aren't met.
func (RequestValidationError) Cause ¶
func (e RequestValidationError) Cause() error
Cause function returns cause value.
func (RequestValidationError) Error ¶
func (e RequestValidationError) Error() string
Error satisfies the builtin error interface
func (RequestValidationError) ErrorName ¶
func (e RequestValidationError) ErrorName() string
ErrorName returns error name.
func (RequestValidationError) Field ¶
func (e RequestValidationError) Field() string
Field function returns field value.
func (RequestValidationError) Key ¶
func (e RequestValidationError) Key() bool
Key function returns key value.
func (RequestValidationError) Reason ¶
func (e RequestValidationError) Reason() string
Reason function returns reason value.
type UnimplementedExampleServiceServer ¶
type UnimplementedExampleServiceServer struct { }
UnimplementedExampleServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedExampleServiceServer) TestValidate ¶
type UnsafeExampleServiceServer ¶
type UnsafeExampleServiceServer interface {
// contains filtered or unexported methods
}
UnsafeExampleServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ExampleServiceServer will result in compilation errors.