Documentation ¶
Overview ¶
Package healthcheck defines the RPC interface for the sansshell Network actions.
Index ¶
- Constants
- Variables
- func RegisterNetworkServer(s grpc.ServiceRegistrar, srv NetworkServer)
- type NetworkClient
- type NetworkClientProxy
- type NetworkServer
- type TCPCheckFailureReason
- func (TCPCheckFailureReason) Descriptor() protoreflect.EnumDescriptor
- func (x TCPCheckFailureReason) Enum() *TCPCheckFailureReason
- func (TCPCheckFailureReason) EnumDescriptor() ([]byte, []int)deprecated
- func (x TCPCheckFailureReason) Number() protoreflect.EnumNumber
- func (x TCPCheckFailureReason) String() string
- func (TCPCheckFailureReason) Type() protoreflect.EnumType
- type TCPCheckManyResponse
- type TCPCheckReply
- func (*TCPCheckReply) Descriptor() ([]byte, []int)deprecated
- func (x *TCPCheckReply) GetFailReason() TCPCheckFailureReason
- func (x *TCPCheckReply) GetOk() bool
- func (*TCPCheckReply) ProtoMessage()
- func (x *TCPCheckReply) ProtoReflect() protoreflect.Message
- func (x *TCPCheckReply) Reset()
- func (x *TCPCheckReply) String() string
- type TCPCheckRequest
- func (*TCPCheckRequest) Descriptor() ([]byte, []int)deprecated
- func (x *TCPCheckRequest) GetHostname() string
- func (x *TCPCheckRequest) GetPort() uint32
- func (x *TCPCheckRequest) GetTimeout() *durationpb.Duration
- func (*TCPCheckRequest) ProtoMessage()
- func (x *TCPCheckRequest) ProtoReflect() protoreflect.Message
- func (x *TCPCheckRequest) Reset()
- func (x *TCPCheckRequest) String() string
- type UnimplementedNetworkServer
- type UnsafeNetworkServer
Constants ¶
const (
Network_TCPCheck_FullMethodName = "/Network.Network/TCPCheck"
)
Variables ¶
var ( TCPCheckFailureReason_name = map[int32]string{ 0: "UNKNOWN", 1: "TIMEOUT", 2: "CONNECTION_REFUSED", 3: "NO_SUCH_HOST", } TCPCheckFailureReason_value = map[string]int32{ "UNKNOWN": 0, "TIMEOUT": 1, "CONNECTION_REFUSED": 2, "NO_SUCH_HOST": 3, } )
Enum value maps for TCPCheckFailureReason.
var File_network_proto protoreflect.FileDescriptor
var Network_ServiceDesc = grpc.ServiceDesc{ ServiceName: "Network.Network", HandlerType: (*NetworkServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "TCPCheck", Handler: _Network_TCPCheck_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "network.proto", }
Network_ServiceDesc is the grpc.ServiceDesc for Network service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterNetworkServer ¶
func RegisterNetworkServer(s grpc.ServiceRegistrar, srv NetworkServer)
Types ¶
type NetworkClient ¶
type NetworkClient interface { // Check TCP Connectivity TCPCheck(ctx context.Context, in *TCPCheckRequest, opts ...grpc.CallOption) (*TCPCheckReply, error) }
NetworkClient is the client API for Network 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 Network service definition
func NewNetworkClient ¶
func NewNetworkClient(cc grpc.ClientConnInterface) NetworkClient
type NetworkClientProxy ¶
type NetworkClientProxy interface { NetworkClient TCPCheckOneMany(ctx context.Context, in *TCPCheckRequest, opts ...grpc.CallOption) (<-chan *TCPCheckManyResponse, error) }
NetworkClientProxy is the superset of NetworkClient which additionally includes the OneMany proxy methods
func NewNetworkClientProxy ¶
func NewNetworkClientProxy(cc *proxy.Conn) NetworkClientProxy
NewNetworkClientProxy creates a NetworkClientProxy for use in proxied connections. NOTE: This takes a proxy.Conn instead of a generic ClientConnInterface as the methods here are only valid in proxy.Conn contexts.
type NetworkServer ¶
type NetworkServer interface { // Check TCP Connectivity TCPCheck(context.Context, *TCPCheckRequest) (*TCPCheckReply, error) }
NetworkServer is the server API for Network service. All implementations should embed UnimplementedNetworkServer for forward compatibility.
The Network service definition
type TCPCheckFailureReason ¶
type TCPCheckFailureReason int32
Enum for TCP check failure reasons
const ( TCPCheckFailureReason_UNKNOWN TCPCheckFailureReason = 0 TCPCheckFailureReason_TIMEOUT TCPCheckFailureReason = 1 TCPCheckFailureReason_CONNECTION_REFUSED TCPCheckFailureReason = 2 TCPCheckFailureReason_NO_SUCH_HOST TCPCheckFailureReason = 3 )
func (TCPCheckFailureReason) Descriptor ¶
func (TCPCheckFailureReason) Descriptor() protoreflect.EnumDescriptor
func (TCPCheckFailureReason) Enum ¶
func (x TCPCheckFailureReason) Enum() *TCPCheckFailureReason
func (TCPCheckFailureReason) EnumDescriptor
deprecated
func (TCPCheckFailureReason) EnumDescriptor() ([]byte, []int)
Deprecated: Use TCPCheckFailureReason.Descriptor instead.
func (TCPCheckFailureReason) Number ¶
func (x TCPCheckFailureReason) Number() protoreflect.EnumNumber
func (TCPCheckFailureReason) String ¶
func (x TCPCheckFailureReason) String() string
func (TCPCheckFailureReason) Type ¶
func (TCPCheckFailureReason) Type() protoreflect.EnumType
type TCPCheckManyResponse ¶
type TCPCheckManyResponse struct { Target string // As targets can be duplicated this is the index into the slice passed to proxy.Conn. Index int Resp *TCPCheckReply Error error }
TCPCheckManyResponse encapsulates a proxy data packet. It includes the target, index, response and possible error returned.
type TCPCheckReply ¶
type TCPCheckReply struct { Ok bool `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"` FailReason *TCPCheckFailureReason `` /* 133-byte string literal not displayed */ // contains filtered or unexported fields }
TCPCheckReply describes the result of a rpc
func (*TCPCheckReply) Descriptor
deprecated
func (*TCPCheckReply) Descriptor() ([]byte, []int)
Deprecated: Use TCPCheckReply.ProtoReflect.Descriptor instead.
func (*TCPCheckReply) GetFailReason ¶
func (x *TCPCheckReply) GetFailReason() TCPCheckFailureReason
func (*TCPCheckReply) GetOk ¶
func (x *TCPCheckReply) GetOk() bool
func (*TCPCheckReply) ProtoMessage ¶
func (*TCPCheckReply) ProtoMessage()
func (*TCPCheckReply) ProtoReflect ¶
func (x *TCPCheckReply) ProtoReflect() protoreflect.Message
func (*TCPCheckReply) Reset ¶
func (x *TCPCheckReply) Reset()
func (*TCPCheckReply) String ¶
func (x *TCPCheckReply) String() string
type TCPCheckRequest ¶
type TCPCheckRequest struct { // The hostname to check Hostname string `protobuf:"bytes,1,opt,name=hostname,proto3" json:"hostname,omitempty"` // The port to check Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` // The timeout duration Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` // contains filtered or unexported fields }
TCP Check describes the request to make check of tcp connectivity check
func (*TCPCheckRequest) Descriptor
deprecated
func (*TCPCheckRequest) Descriptor() ([]byte, []int)
Deprecated: Use TCPCheckRequest.ProtoReflect.Descriptor instead.
func (*TCPCheckRequest) GetHostname ¶
func (x *TCPCheckRequest) GetHostname() string
func (*TCPCheckRequest) GetPort ¶
func (x *TCPCheckRequest) GetPort() uint32
func (*TCPCheckRequest) GetTimeout ¶
func (x *TCPCheckRequest) GetTimeout() *durationpb.Duration
func (*TCPCheckRequest) ProtoMessage ¶
func (*TCPCheckRequest) ProtoMessage()
func (*TCPCheckRequest) ProtoReflect ¶
func (x *TCPCheckRequest) ProtoReflect() protoreflect.Message
func (*TCPCheckRequest) Reset ¶
func (x *TCPCheckRequest) Reset()
func (*TCPCheckRequest) String ¶
func (x *TCPCheckRequest) String() string
type UnimplementedNetworkServer ¶
type UnimplementedNetworkServer struct{}
UnimplementedNetworkServer 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 (UnimplementedNetworkServer) TCPCheck ¶
func (UnimplementedNetworkServer) TCPCheck(context.Context, *TCPCheckRequest) (*TCPCheckReply, error)
type UnsafeNetworkServer ¶
type UnsafeNetworkServer interface {
// contains filtered or unexported methods
}
UnsafeNetworkServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to NetworkServer will result in compilation errors.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package client provides the client interface for 'network'
|
Package client provides the client interface for 'network' |
Package server implements the sansshell 'Network' service.
|
Package server implements the sansshell 'Network' service. |