varsprobe

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: MIT Imports: 7 Imported by: 1

Documentation

Overview

Package varsprobe implements a probe for /vars, i.e. expvar package variables.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Alert

func Alert(fn prober.AlertFn) func(*VarsProber)

Alert sets a custom alerting function.

If Alert is not called, the probes.SendAlertEmail function is called.

func Desc

func Desc(desc string) func(*VarsProber)

Desc sets specified description.

func Key

func Key(k string) func(*VarsProber)

Key sets key to check.

func Name

func Name(name string) func(*VarsProber)

Name sets specified name.

func New

func New(target string, options ...func(*VarsProber)) *prober.Probe

New returns a new instance of the vars probe with specified options.

func NewWithGeneric

func NewWithGeneric(target string, genericOpts []prober.Option, options ...func(*VarsProber)) *prober.Probe

NewWithGeneric returns a new instance of the vars probe with specified options.

NewWithGeneric passes through specified prober.Options, after applying the varsprobe-specific options.

func WantValue

func WantValue(v string) func(*VarsProber)

WantValue sets value to expect key to have.

Types

type VarsProber

type VarsProber struct {
	Target string // addr to probe /vars for
	Key    string // variable key to probe for
	// contains filtered or unexported fields
}

VarsProber probes a target host's /vars page.

func (*VarsProber) Alert

func (p *VarsProber) Alert(name, desc string, badness int, records prober.Records) error

Alert calls the prober.AlertFn for the prober.

If no prober.AlertFn was set with the Alert() option, probes.SendAlertEmail is used by default.

func (*VarsProber) Probe

func (p *VarsProber) Probe() prober.Result

Probe verifies that the target's /vars page is as expected.

func (VarsProber) String

func (p VarsProber) String() string

String returns the human-readable description of the prober.

Jump to

Keyboard shortcuts

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