health

package
v3.7.8 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 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 added in v3.3.17

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

func NewHandler added in v3.3.7

func NewHandler(opts ...Option) *Handler

func (*Handler) Live added in v3.3.17

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

func (*Handler) Ready added in v3.3.17

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

func (*Handler) Version added in v3.3.17

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