peerhealth

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_pkg_peerhealth_peerhealth_proto protoreflect.FileDescriptor
View Source
var PeerHealth_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "selfnoderemediation.health.PeerHealth",
	HandlerType: (*PeerHealthServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "IsHealthy",
			Handler:    _PeerHealth_IsHealthy_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "pkg/peerhealth/peerhealth.proto",
}

PeerHealth_ServiceDesc is the grpc.ServiceDesc for PeerHealth service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterPeerHealthServer

func RegisterPeerHealthServer(s grpc.ServiceRegistrar, srv PeerHealthServer)

Types

type Client

type Client struct {
	PeerHealthClient
	// contains filtered or unexported fields
}

func NewClient

func NewClient(serverAddr string, peerDialTimeout time.Duration, log logr.Logger, clientCreds credentials.TransportCredentials) (*Client, error)

NewClient return a new client for peer health checks. Don't forget to close it when done

func (*Client) Close

func (c *Client) Close()

type HealthRequest

type HealthRequest struct {
	NodeName    string `protobuf:"bytes,1,opt,name=nodeName,proto3" json:"nodeName,omitempty"`
	MachineName string `protobuf:"bytes,2,opt,name=machineName,proto3" json:"machineName,omitempty"`
	// contains filtered or unexported fields
}

func (*HealthRequest) Descriptor deprecated

func (*HealthRequest) Descriptor() ([]byte, []int)

Deprecated: Use HealthRequest.ProtoReflect.Descriptor instead.

func (*HealthRequest) GetMachineName added in v0.8.0

func (x *HealthRequest) GetMachineName() string

func (*HealthRequest) GetNodeName

func (x *HealthRequest) GetNodeName() string

func (*HealthRequest) ProtoMessage

func (*HealthRequest) ProtoMessage()

func (*HealthRequest) ProtoReflect

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

func (*HealthRequest) Reset

func (x *HealthRequest) Reset()

func (*HealthRequest) String

func (x *HealthRequest) String() string

type HealthResponse

type HealthResponse struct {
	Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*HealthResponse) Descriptor deprecated

func (*HealthResponse) Descriptor() ([]byte, []int)

Deprecated: Use HealthResponse.ProtoReflect.Descriptor instead.

func (*HealthResponse) GetStatus

func (x *HealthResponse) GetStatus() int32

func (*HealthResponse) ProtoMessage

func (*HealthResponse) ProtoMessage()

func (*HealthResponse) ProtoReflect

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

func (*HealthResponse) Reset

func (x *HealthResponse) Reset()

func (*HealthResponse) String

func (x *HealthResponse) String() string

type PeerHealthClient

type PeerHealthClient interface {
	IsHealthy(ctx context.Context, in *HealthRequest, opts ...grpc.CallOption) (*HealthResponse, error)
}

PeerHealthClient is the client API for PeerHealth 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 NewPeerHealthClient

func NewPeerHealthClient(cc grpc.ClientConnInterface) PeerHealthClient

type PeerHealthServer

type PeerHealthServer interface {
	IsHealthy(context.Context, *HealthRequest) (*HealthResponse, error)
	// contains filtered or unexported methods
}

PeerHealthServer is the server API for PeerHealth service. All implementations must embed UnimplementedPeerHealthServer for forward compatibility

type Server

type Server struct {
	UnimplementedPeerHealthServer
	// contains filtered or unexported fields
}

func NewServer

NewServer returns a new Server

func (Server) IsHealthy

func (s Server) IsHealthy(ctx context.Context, request *HealthRequest) (*HealthResponse, error)

IsHealthy checks if the given node is healthy

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start implements Runnable for usage by manager

type UnimplementedPeerHealthServer

type UnimplementedPeerHealthServer struct {
}

UnimplementedPeerHealthServer must be embedded to have forward compatible implementations.

func (UnimplementedPeerHealthServer) IsHealthy

type UnsafePeerHealthServer

type UnsafePeerHealthServer interface {
	// contains filtered or unexported methods
}

UnsafePeerHealthServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PeerHealthServer will result in compilation errors.

Jump to

Keyboard shortcuts

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