healthcheck

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const Mount = "/mnt"

Mount is the mount point for the healthcheck sidecar pvc. it should be mounted on /<Mount>/<pvc>

View Source
const Port = 1251

Port is the port for the healthcheck sidecar.

Variables

This section is empty.

Functions

func DiskUsage

func DiskUsage(pvcs string, mount string) http.HandlerFunc

DiskUsage returns a handler which responds with disk statistics in JSON. Path is the filesystem path from which to check disk usage.

Types

type Client

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

Client can be used to query healthcheck information.

func NewClient

func NewClient(client *http.Client) *Client

func (Client) DiskUsage

func (c Client) DiskUsage(ctx context.Context, host string) ([]DiskUsageResponse, error)

DiskUsage returns disk usage statistics or an error if unable to obtain. Do not include the port in the host.

type DiskUsageResponse

type DiskUsageResponse struct {
	Dir       string `json:"dir"`
	PvcName   string `json:"pvc_name"`
	AllBytes  uint64 `json:"all_bytes,omitempty"`
	FreeBytes uint64 `json:"free_bytes,omitempty"`
	Error     string `json:"error,omitempty"`
}

DiskUsageResponse returns disk statistics in bytes.

Jump to

Keyboard shortcuts

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