prober

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Overview

Package prober provides a framework for implementing Chainguard probers that expose an HTTP endpoint for health checking.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Go

func Go(_ context.Context, i Interface)

Go launches the prober process, and does not return. On errors it terminates the process.

Types

type Func

type Func func(context.Context) error

Func is a convenience wrapper for turning a function into an Interface.

Example
package main

import (
	"context"
	"fmt"

	"github.com/chainguard-dev/terraform-infra-common/pkg/prober"
)

func main() {
	// Func adapts a plain function into a prober.Interface.
	p := prober.Func(func(_ context.Context) error {
		fmt.Println("probing...")
		return nil
	})
	_ = p
}

func (Func) Probe

func (pf Func) Probe(ctx context.Context) error

Probe implements Interface

type Interface

type Interface interface {
	// Probe performs a single probe and is passed the HTTP request context.
	Probe(context.Context) error
}

Interface is implemented by Chainguard probers to encapsulate their probing logic

Jump to

Keyboard shortcuts

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