Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterPingHTTPServer(s *http.Server, srv PingHTTPServer)
- func RegisterPingServer(s grpc.ServiceRegistrar, srv PingServer)
- type PingClient
- type PingHTTPClient
- type PingHTTPClientImpl
- type PingHTTPServer
- type PingReply
- func (*PingReply) Descriptor() ([]byte, []int)deprecated
- func (x *PingReply) GetMetadata() map[string]string
- func (x *PingReply) GetName() string
- func (x *PingReply) GetNamespace() string
- func (x *PingReply) GetVersion() string
- func (*PingReply) ProtoMessage()
- func (x *PingReply) ProtoReflect() protoreflect.Message
- func (x *PingReply) Reset()
- func (x *PingReply) String() string
- func (m *PingReply) Validate() error
- func (m *PingReply) ValidateAll() error
- type PingReplyMultiError
- type PingReplyValidationError
- type PingRequest
- func (*PingRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PingRequest) GetName() string
- func (*PingRequest) ProtoMessage()
- func (x *PingRequest) ProtoReflect() protoreflect.Message
- func (x *PingRequest) Reset()
- func (x *PingRequest) String() string
- func (m *PingRequest) Validate() error
- func (m *PingRequest) ValidateAll() error
- type PingRequestMultiError
- type PingRequestValidationError
- func (e PingRequestValidationError) Cause() error
- func (e PingRequestValidationError) Error() string
- func (e PingRequestValidationError) ErrorName() string
- func (e PingRequestValidationError) Field() string
- func (e PingRequestValidationError) Key() bool
- func (e PingRequestValidationError) Reason() string
- type PingServer
- type UnimplementedPingServer
- type UnsafePingServer
Constants ¶
const OperationPingCheck = "/api.ping.Ping/Check"
const (
Ping_Check_FullMethodName = "/api.ping.Ping/Check"
)
Variables ¶
var File_ping_ping_proto protoreflect.FileDescriptor
var Ping_ServiceDesc = grpc.ServiceDesc{ ServiceName: "api.ping.Ping", HandlerType: (*PingServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Check", Handler: _Ping_Check_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "ping/ping.proto", }
Ping_ServiceDesc is the grpc.ServiceDesc for Ping service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterPingHTTPServer ¶
func RegisterPingHTTPServer(s *http.Server, srv PingHTTPServer)
func RegisterPingServer ¶
func RegisterPingServer(s grpc.ServiceRegistrar, srv PingServer)
Types ¶
type PingClient ¶
type PingClient interface { // 健康检查接口 Check(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingReply, error) }
PingClient is the client API for Ping 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 NewPingClient ¶
func NewPingClient(cc grpc.ClientConnInterface) PingClient
type PingHTTPClient ¶
type PingHTTPClient interface {
Check(ctx context.Context, req *PingRequest, opts ...http.CallOption) (rsp *PingReply, err error)
}
func NewPingHTTPClient ¶
func NewPingHTTPClient(client *http.Client) PingHTTPClient
type PingHTTPClientImpl ¶
type PingHTTPClientImpl struct {
// contains filtered or unexported fields
}
func (*PingHTTPClientImpl) Check ¶
func (c *PingHTTPClientImpl) Check(ctx context.Context, in *PingRequest, opts ...http.CallOption) (*PingReply, error)
type PingHTTPServer ¶
type PingHTTPServer interface { // Check 健康检查接口 Check(context.Context, *PingRequest) (*PingReply, error) }
type PingReply ¶
type PingReply struct { // 响应者名称 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // 版本号 Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // 命名空间 Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` // 元数据 Metadata map[string]string `` /* 157-byte string literal not displayed */ // contains filtered or unexported fields }
健康检查响应
func (*PingReply) Descriptor
deprecated
func (*PingReply) GetMetadata ¶
func (*PingReply) GetNamespace ¶
func (*PingReply) GetVersion ¶
func (*PingReply) ProtoMessage ¶
func (*PingReply) ProtoMessage()
func (*PingReply) ProtoReflect ¶
func (x *PingReply) ProtoReflect() protoreflect.Message
func (*PingReply) Validate ¶
Validate checks the field values on PingReply 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 (*PingReply) ValidateAll ¶
ValidateAll checks the field values on PingReply 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 PingReplyMultiError, or nil if none found.
type PingReplyMultiError ¶
type PingReplyMultiError []error
PingReplyMultiError is an error wrapping multiple validation errors returned by PingReply.ValidateAll() if the designated constraints aren't met.
func (PingReplyMultiError) AllErrors ¶
func (m PingReplyMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (PingReplyMultiError) Error ¶
func (m PingReplyMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type PingReplyValidationError ¶
type PingReplyValidationError struct {
// contains filtered or unexported fields
}
PingReplyValidationError is the validation error returned by PingReply.Validate if the designated constraints aren't met.
func (PingReplyValidationError) Cause ¶
func (e PingReplyValidationError) Cause() error
Cause function returns cause value.
func (PingReplyValidationError) Error ¶
func (e PingReplyValidationError) Error() string
Error satisfies the builtin error interface
func (PingReplyValidationError) ErrorName ¶
func (e PingReplyValidationError) ErrorName() string
ErrorName returns error name.
func (PingReplyValidationError) Field ¶
func (e PingReplyValidationError) Field() string
Field function returns field value.
func (PingReplyValidationError) Key ¶
func (e PingReplyValidationError) Key() bool
Key function returns key value.
func (PingReplyValidationError) Reason ¶
func (e PingReplyValidationError) Reason() string
Reason function returns reason value.
type PingRequest ¶
type PingRequest struct { // 请求者名称, 非必填 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
健康检查请求
func (*PingRequest) Descriptor
deprecated
func (*PingRequest) Descriptor() ([]byte, []int)
Deprecated: Use PingRequest.ProtoReflect.Descriptor instead.
func (*PingRequest) GetName ¶
func (x *PingRequest) GetName() string
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
func (*PingRequest) Validate ¶
func (m *PingRequest) Validate() error
Validate checks the field values on PingRequest 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 (*PingRequest) ValidateAll ¶
func (m *PingRequest) ValidateAll() error
ValidateAll checks the field values on PingRequest 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 PingRequestMultiError, or nil if none found.
type PingRequestMultiError ¶
type PingRequestMultiError []error
PingRequestMultiError is an error wrapping multiple validation errors returned by PingRequest.ValidateAll() if the designated constraints aren't met.
func (PingRequestMultiError) AllErrors ¶
func (m PingRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (PingRequestMultiError) Error ¶
func (m PingRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type PingRequestValidationError ¶
type PingRequestValidationError struct {
// contains filtered or unexported fields
}
PingRequestValidationError is the validation error returned by PingRequest.Validate if the designated constraints aren't met.
func (PingRequestValidationError) Cause ¶
func (e PingRequestValidationError) Cause() error
Cause function returns cause value.
func (PingRequestValidationError) Error ¶
func (e PingRequestValidationError) Error() string
Error satisfies the builtin error interface
func (PingRequestValidationError) ErrorName ¶
func (e PingRequestValidationError) ErrorName() string
ErrorName returns error name.
func (PingRequestValidationError) Field ¶
func (e PingRequestValidationError) Field() string
Field function returns field value.
func (PingRequestValidationError) Key ¶
func (e PingRequestValidationError) Key() bool
Key function returns key value.
func (PingRequestValidationError) Reason ¶
func (e PingRequestValidationError) Reason() string
Reason function returns reason value.
type PingServer ¶
type PingServer interface { // 健康检查接口 Check(context.Context, *PingRequest) (*PingReply, error) // contains filtered or unexported methods }
PingServer is the server API for Ping service. All implementations must embed UnimplementedPingServer for forward compatibility
type UnimplementedPingServer ¶
type UnimplementedPingServer struct { }
UnimplementedPingServer must be embedded to have forward compatible implementations.
func (UnimplementedPingServer) Check ¶
func (UnimplementedPingServer) Check(context.Context, *PingRequest) (*PingReply, error)
type UnsafePingServer ¶
type UnsafePingServer interface {
// contains filtered or unexported methods
}
UnsafePingServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PingServer will result in compilation errors.