health

package
v3.8.18 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HealthName = "Health"

	HealthEndpoints = []api.Endpoint{
		{
			Name:    "Health.Live",
			Path:    []string{"/live"},
			Method:  []string{"GET"},
			Handler: "rpc",
		},
		{
			Name:    "Health.Ready",
			Path:    []string{"/ready"},
			Method:  []string{"GET"},
			Handler: "rpc",
		},
		{
			Name:    "Health.Version",
			Path:    []string{"/version"},
			Method:  []string{"GET"},
			Handler: "rpc",
		},
	}
)

Functions

func NewHealthEndpoints

func NewHealthEndpoints() []api.Endpoint

func RegisterHealthServer

func RegisterHealthServer(s server.Server, sh HealthServer, 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) Live

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

func (*Handler) Ready

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

func (*Handler) Version

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

type HealthServer

type HealthServer 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