Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterPersonServiceServer(s grpc.ServiceRegistrar, srv PersonServiceServer)
- type PersonMessage
- func (*PersonMessage) Descriptor() ([]byte, []int)deprecated
- func (x *PersonMessage) GetAge() int32
- func (x *PersonMessage) GetName() string
- func (*PersonMessage) ProtoMessage()
- func (x *PersonMessage) ProtoReflect() protoreflect.Message
- func (x *PersonMessage) Reset()
- func (x *PersonMessage) String() string
- func (m *PersonMessage) Validate() error
- func (m *PersonMessage) ValidateAll() error
- type PersonMessageMultiError
- type PersonMessageValidationError
- func (e PersonMessageValidationError) Cause() error
- func (e PersonMessageValidationError) Error() string
- func (e PersonMessageValidationError) ErrorName() string
- func (e PersonMessageValidationError) Field() string
- func (e PersonMessageValidationError) Key() bool
- func (e PersonMessageValidationError) Reason() string
- type PersonServiceClient
- type PersonServiceServer
- type UnimplementedPersonServiceServer
- type UnsafePersonServiceServer
Constants ¶
const (
PersonService_GetPerson_FullMethodName = "/grpc.person.service.v1.PersonService/GetPerson"
)
Variables ¶
var File_prototpl_person_service_person_service_proto protoreflect.FileDescriptor
var PersonService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "grpc.person.service.v1.PersonService", HandlerType: (*PersonServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetPerson", Handler: _PersonService_GetPerson_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "prototpl/person-service/person-service.proto", }
PersonService_ServiceDesc is the grpc.ServiceDesc for PersonService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterPersonServiceServer ¶
func RegisterPersonServiceServer(s grpc.ServiceRegistrar, srv PersonServiceServer)
Types ¶
type PersonMessage ¶
type PersonMessage struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Age int32 `protobuf:"varint,2,opt,name=age,proto3" json:"age,omitempty"` // contains filtered or unexported fields }
func (*PersonMessage) Descriptor
deprecated
func (*PersonMessage) Descriptor() ([]byte, []int)
Deprecated: Use PersonMessage.ProtoReflect.Descriptor instead.
func (*PersonMessage) GetAge ¶
func (x *PersonMessage) GetAge() int32
func (*PersonMessage) GetName ¶
func (x *PersonMessage) GetName() string
func (*PersonMessage) ProtoMessage ¶
func (*PersonMessage) ProtoMessage()
func (*PersonMessage) ProtoReflect ¶
func (x *PersonMessage) ProtoReflect() protoreflect.Message
func (*PersonMessage) Reset ¶
func (x *PersonMessage) Reset()
func (*PersonMessage) String ¶
func (x *PersonMessage) String() string
func (*PersonMessage) Validate ¶
func (m *PersonMessage) Validate() error
Validate checks the field values on PersonMessage 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 (*PersonMessage) ValidateAll ¶
func (m *PersonMessage) ValidateAll() error
ValidateAll checks the field values on PersonMessage 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 PersonMessageMultiError, or nil if none found.
type PersonMessageMultiError ¶
type PersonMessageMultiError []error
PersonMessageMultiError is an error wrapping multiple validation errors returned by PersonMessage.ValidateAll() if the designated constraints aren't met.
func (PersonMessageMultiError) AllErrors ¶
func (m PersonMessageMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (PersonMessageMultiError) Error ¶
func (m PersonMessageMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type PersonMessageValidationError ¶
type PersonMessageValidationError struct {
// contains filtered or unexported fields
}
PersonMessageValidationError is the validation error returned by PersonMessage.Validate if the designated constraints aren't met.
func (PersonMessageValidationError) Cause ¶
func (e PersonMessageValidationError) Cause() error
Cause function returns cause value.
func (PersonMessageValidationError) Error ¶
func (e PersonMessageValidationError) Error() string
Error satisfies the builtin error interface
func (PersonMessageValidationError) ErrorName ¶
func (e PersonMessageValidationError) ErrorName() string
ErrorName returns error name.
func (PersonMessageValidationError) Field ¶
func (e PersonMessageValidationError) Field() string
Field function returns field value.
func (PersonMessageValidationError) Key ¶
func (e PersonMessageValidationError) Key() bool
Key function returns key value.
func (PersonMessageValidationError) Reason ¶
func (e PersonMessageValidationError) Reason() string
Reason function returns reason value.
type PersonServiceClient ¶
type PersonServiceClient interface {
GetPerson(ctx context.Context, in *PersonMessage, opts ...grpc.CallOption) (*PersonMessage, error)
}
PersonServiceClient is the client API for PersonService 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 NewPersonServiceClient ¶
func NewPersonServiceClient(cc grpc.ClientConnInterface) PersonServiceClient
type PersonServiceServer ¶
type PersonServiceServer interface { GetPerson(context.Context, *PersonMessage) (*PersonMessage, error) // contains filtered or unexported methods }
PersonServiceServer is the server API for PersonService service. All implementations must embed UnimplementedPersonServiceServer for forward compatibility
type UnimplementedPersonServiceServer ¶
type UnimplementedPersonServiceServer struct { }
UnimplementedPersonServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedPersonServiceServer) GetPerson ¶
func (UnimplementedPersonServiceServer) GetPerson(context.Context, *PersonMessage) (*PersonMessage, error)
type UnsafePersonServiceServer ¶
type UnsafePersonServiceServer interface {
// contains filtered or unexported methods
}
UnsafePersonServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PersonServiceServer will result in compilation errors.