ping

package
v0.0.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const OperationPingCheck = "/api.ping.Ping/Check"
View Source
const (
	Ping_Check_FullMethodName = "/api.ping.Ping/Check"
)

Variables

View Source
var File_ping_ping_proto protoreflect.FileDescriptor
View Source
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(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) Descriptor() ([]byte, []int)

Deprecated: Use PingReply.ProtoReflect.Descriptor instead.

func (*PingReply) GetMetadata

func (x *PingReply) GetMetadata() map[string]string

func (*PingReply) GetName

func (x *PingReply) GetName() string

func (*PingReply) GetNamespace

func (x *PingReply) GetNamespace() string

func (*PingReply) GetVersion

func (x *PingReply) GetVersion() string

func (*PingReply) ProtoMessage

func (*PingReply) ProtoMessage()

func (*PingReply) ProtoReflect

func (x *PingReply) ProtoReflect() protoreflect.Message

func (*PingReply) Reset

func (x *PingReply) Reset()

func (*PingReply) String

func (x *PingReply) String() string

func (*PingReply) Validate

func (m *PingReply) Validate() error

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

func (m *PingReply) ValidateAll() error

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

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

Cause function returns cause value.

func (PingRequestValidationError) Error

Error satisfies the builtin error interface

func (PingRequestValidationError) ErrorName

func (e PingRequestValidationError) ErrorName() string

ErrorName returns error name.

func (PingRequestValidationError) Field

Field function returns field value.

func (PingRequestValidationError) Key

Key function returns key value.

func (PingRequestValidationError) Reason

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL