checker

package
v1.17.2 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: MIT Imports: 9 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidStatusCode = errors.New("invalid status code")

ErrInvalidStatusCode when we have errors that are not in the 200 range.

Functions

This section is empty.

Types

type Checker

type Checker interface {
	Check(ctx context.Context) error
}

Checker will check a system.

type DBChecker

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

DBChecker for SQL.

func NewDBChecker

func NewDBChecker(pinger sql.Pinger, timeout time.Duration) *DBChecker

NewDBChecker for SQL.

func (*DBChecker) Check

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

Check the DB.

type HTTPChecker

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

HTTPChecker for a URL.

func NewHTTPChecker

func NewHTTPChecker(url string, client *http.Client) *HTTPChecker

NewHTTPChecker with URL and client.

func (*HTTPChecker) Check

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

Check the URL with a GET.

type NoopChecker

type NoopChecker struct{}

NoopChecker with no functionality.

func NewNoopChecker

func NewNoopChecker() *NoopChecker

NewNoopChecker with no functionality.

func (*NoopChecker) Check

func (c *NoopChecker) Check(_ context.Context) error

Check does a NOOP.

type ReadyChecker

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

ReadyChecker for when prepared for something.

func NewReadyChecker

func NewReadyChecker(err error) *ReadyChecker

NewReadyChecker with a specific error.

func (*ReadyChecker) Check

func (c *ReadyChecker) Check(_ context.Context) error

Check the if ready.

func (*ReadyChecker) Ready

func (c *ReadyChecker) Ready()

Ready marks the checker as done.

type TCPChecker

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

TCPChecker for an address.

func NewTCPChecker

func NewTCPChecker(address string, timeout time.Duration) *TCPChecker

NewTCPChecker for address.

func NewTCPCheckerWithDialer

func NewTCPCheckerWithDialer(address string, timeout time.Duration, dialer net.Dialer) *TCPChecker

NewTCPCheckerWithDialer for address.

func (*TCPChecker) Check

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

Check the address.

Jump to

Keyboard shortcuts

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