health

package
v4.0.14 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HealthServiceName = "HealthService"
)
View Source
var (
	HealthServiceServerEndpoints = []v4.EndpointMetadata{
		{
			Name:   "HealthService.Live",
			Path:   "/live",
			Method: "GET",
			Body:   "",
			Stream: false,
		},
		{
			Name:   "HealthService.Ready",
			Path:   "/ready",
			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 ...options.Option) 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) 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 HealthServiceServer

type HealthServiceServer interface {
	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 LiveChecks

func LiveChecks(fns ...CheckFunc) Option

func Name

func Name(name string) Option

func ReadyChecks

func ReadyChecks(fns ...CheckFunc) Option

func Version

func Version(version string) Option

type Options

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

Jump to

Keyboard shortcuts

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