health_handler

package
v3.11.37 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HealthServiceName = "HealthService"
)
View Source
var (
	HealthServiceServerEndpoints = []v3.EndpointMetadata{
		{
			Name:   "HealthService.Healthy",
			Path:   "/health",
			Method: "GET",
			Body:   "",
			Stream: false,
		},
		{
			Name:   "HealthService.Healthy",
			Path:   "/healthz",
			Method: "GET",
			Body:   "",
			Stream: false,
		},
		{
			Name:   "HealthService.Live",
			Path:   "/live",
			Method: "GET",
			Body:   "",
			Stream: false,
		},
		{
			Name:   "HealthService.Live",
			Path:   "/livez",
			Method: "GET",
			Body:   "",
			Stream: false,
		},
		{
			Name:   "HealthService.Ready",
			Path:   "/ready",
			Method: "GET",
			Body:   "",
			Stream: false,
		},
		{
			Name:   "HealthService.Ready",
			Path:   "/readyz",
			Method: "GET",
			Body:   "",
			Stream: false,
		},
		{
			Name:   "HealthService.Version",
			Path:   "/version",
			Method: "GET",
			Body:   "",
			Stream: false,
		},
	}
)

Functions

func RegisterHealthServiceServer

func RegisterHealthServiceServer(s server.Server, sh HealthServiceServer, opts ...server.HandlerOption) error

Types

type CheckFunc

type CheckFunc func(context.Context) error

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(opts ...Option) *Handler

func (*Handler) Healthy added in v3.11.35

func (h *Handler) Healthy(ctx context.Context, req *codecpb.Frame, rsp *codecpb.Frame) error

func (*Handler) Live

func (h *Handler) Live(ctx context.Context, req *codecpb.Frame, rsp *codecpb.Frame) error

func (*Handler) Ready

func (h *Handler) Ready(ctx context.Context, req *codecpb.Frame, rsp *codecpb.Frame) error

func (*Handler) Version

func (h *Handler) Version(ctx context.Context, req *codecpb.Frame, rsp *codecpb.Frame) error

type HealthServiceClient added in v3.10.31

type HealthServiceClient interface {
	Healthy(ctx context.Context, req *codec.Frame, opts ...client.CallOption) (*codec.Frame, error)
	Live(ctx context.Context, req *codec.Frame, opts ...client.CallOption) (*codec.Frame, error)
	Ready(ctx context.Context, req *codec.Frame, opts ...client.CallOption) (*codec.Frame, error)
	Version(ctx context.Context, req *codec.Frame, opts ...client.CallOption) (*codec.Frame, error)
}

func NewHealthServiceClient added in v3.10.31

func NewHealthServiceClient(name string, c client.Client) HealthServiceClient

type HealthServiceServer

type HealthServiceServer interface {
	Healthy(ctx context.Context, req *codec.Frame, rsp *codec.Frame) error
	Live(ctx context.Context, req *codec.Frame, rsp *codec.Frame) error
	Ready(ctx context.Context, req *codec.Frame, rsp *codec.Frame) error
	Version(ctx context.Context, req *codec.Frame, rsp *codec.Frame) error
}

type Option

type Option func(*Options)

func HealthChecks added in v3.11.35

func HealthChecks(fns ...CheckFunc) Option

func LiveChecks

func LiveChecks(fns ...CheckFunc) Option

func Name

func Name(name string) Option

func ReadyChecks

func ReadyChecks(fns ...CheckFunc) Option

func Service added in v3.11.35

func Service(s ...Stater) Option

func Version

func Version(version string) Option

type Options

type Options struct {
	Version      string
	Name         string
	Staters      []Stater
	LiveChecks   []CheckFunc
	ReadyChecks  []CheckFunc
	HealthChecks []CheckFunc
}

type Stater added in v3.11.35

type Stater interface {
	Live() bool
	Ready() bool
	Health() bool
}

Jump to

Keyboard shortcuts

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