Help us shape the future of Go! Take the 2026 Go Developer Survey

health

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigAdd

func ConfigAdd(path string)

Types

type Checker

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

Checker health checker for go driver for oracle.

func NewChecker

func NewChecker(db *sql.DB) *Checker

NewChecker returns a new health checker.

func (*Checker) Check

func (c *Checker) Check(ctx context.Context) error

Check checks if db server is up.

type HealthPlugin

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

HealthPlugin implements the factory’s Plugin hooks for health checks.

func NewHealthPlugin

func NewHealthPlugin() *HealthPlugin

NewHealthPlugin constructs the plugin with default Options.

func NewHealthPluginWithConfigPath

func NewHealthPluginWithConfigPath(path string) (*HealthPlugin, error)

NewHealthPluginWithConfigPath loads Options from a config file.

func NewHealthPluginWithOptions

func NewHealthPluginWithOptions(opts *Options) *HealthPlugin

NewHealthPluginWithOptions constructs the plugin from explicit Options.

func (*HealthPlugin) InitDB

func (h *HealthPlugin) InitDB(ctx context.Context, db *sql.DB) error

InitDB is called immediately after sql.OpenDB: it registers the health check.

func (*HealthPlugin) WrapConnector

func (h *HealthPlugin) WrapConnector(ctx context.Context, connector driver.Connector) (driver.Connector, error)

WrapConnector is a no-op: health checks don’t need to wrap the driver.

type Options

type Options struct {
	Name        string
	Enabled     bool
	Description string
	Required    bool
}

Options represents a health checker for go driver for oracle options.

func NewOptions

func NewOptions() (*Options, error)

NewOptions returns options from config file or environment vars.

func NewOptionsWithPath

func NewOptionsWithPath(path string) (opts *Options, err error)

NewOptionsWithPath unmarshals a given key path into options and returns it.

Jump to

Keyboard shortcuts

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