Documentation
¶
Index ¶
- Variables
- func DebugOutput(module *config.Module, logBuffer *bytes.Buffer, registry *prometheus.Registry) string
- func Handler(w http.ResponseWriter, r *http.Request, c *config.Config, logger *slog.Logger, ...)
- func ProbeDNS(ctx context.Context, target string, module config.Module, ...) bool
- func ProbeGRPC(ctx context.Context, target string, module config.Module, ...) (success bool)
- func ProbeHTTP(ctx context.Context, target string, module config.Module, ...) (success bool)
- func ProbeICMP(ctx context.Context, target string, module config.Module, ...) (success bool)
- func ProbeTCP(ctx context.Context, target string, module config.Module, ...) bool
- func ProbeUnix(ctx context.Context, target string, module config.Module, ...) bool
- func ProbeWebsocket(ctx context.Context, target string, module config.Module, ...) (success bool)
- type GRPCHealthCheck
- type ProbeFn
- type Result
- type ResultHistory
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Probers = map[string]ProbeFn{ "http": ProbeHTTP, "tcp": ProbeTCP, "icmp": ProbeICMP, "dns": ProbeDNS, "grpc": ProbeGRPC, "unix": ProbeUnix, "websocket": ProbeWebsocket, } )
Functions ¶
func DebugOutput ¶
func DebugOutput(module *config.Module, logBuffer *bytes.Buffer, registry *prometheus.Registry) string
DebugOutput returns plaintext debug output for a probe.
Types ¶
type GRPCHealthCheck ¶
type GRPCHealthCheck interface {
Check(c context.Context, service string, md metadata.MD) (bool, codes.Code, *peer.Peer, string, error)
}
func NewGrpcHealthCheckClient ¶
func NewGrpcHealthCheckClient(conn *grpc.ClientConn) GRPCHealthCheck
type ResultHistory ¶
type ResultHistory struct {
MaxResults uint
// contains filtered or unexported fields
}
ResultHistory contains two history slices: `results` contains most recent `maxResults` results. After they expire out of `results`, failures will be saved in `preservedFailedResults`. This ensures that we are always able to see debug information about recent failures.
func (*ResultHistory) Add ¶
func (rh *ResultHistory) Add(moduleName, target, debugOutput string, success bool)
Add a result to the history.
func (*ResultHistory) GetById ¶
func (rh *ResultHistory) GetById(id int64) *Result
GetById returns a given result by id.
func (*ResultHistory) GetByTargetAndModule ¶
func (rh *ResultHistory) GetByTargetAndModule(target string, module string) *Result
GetByTargetAndModule returns a given result by target url, optionally filtered by a module name.
func (*ResultHistory) List ¶
func (rh *ResultHistory) List() []*Result
List returns a list of all results.
Click to show internal directories.
Click to hide internal directories.