base

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package base is the base package for all probes

Index

Constants

View Source
const (
	ServiceUp   int = 1
	ServiceDown int = 0
)

Probe Simple Status

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultProbe added in v1.6.0

type DefaultProbe struct {
	ProbeKind                            string        `yaml:"-" json:"-"`
	ProbeTag                             string        `yaml:"-" json:"-"`
	ProbeName                            string        `yaml:"name" json:"name" jsonschema:"required,title=Probe Name,description=the name of probe must be unique"`
	ProbeChannels                        []string      `` /* 133-byte string literal not displayed */
	ProbeTimeout                         time.Duration `` /* 143-byte string literal not displayed */
	ProbeTimeInterval                    time.Duration `` /* 147-byte string literal not displayed */
	global.StatusChangeThresholdSettings `yaml:",inline" json:",inline"`
	ProbeFunc                            ProbeFuncType `yaml:"-" json:"-"`
	ProbeResult                          *probe.Result `yaml:"-" json:"-"`
	// contains filtered or unexported fields
}

DefaultProbe is the default options for all probe

func (*DefaultProbe) Channels added in v1.6.0

func (d *DefaultProbe) Channels() []string

Channels return the probe channels

func (*DefaultProbe) CheckStatusThreshold added in v1.9.0

func (d *DefaultProbe) CheckStatusThreshold() probe.Status

CheckStatusThreshold check the status threshold

func (*DefaultProbe) Config added in v1.6.0

func (d *DefaultProbe) Config(gConf global.ProbeSettings,
	kind, tag, name, endpoint string, fn ProbeFuncType) error

Config default config

func (*DefaultProbe) DownTimeCalculation added in v1.6.0

func (d *DefaultProbe) DownTimeCalculation(status probe.Status)

DownTimeCalculation calculate the down time

func (*DefaultProbe) ExportMetrics added in v1.6.0

func (d *DefaultProbe) ExportMetrics()

ExportMetrics export the metrics

func (*DefaultProbe) GetProxyConnection added in v1.8.0

func (d *DefaultProbe) GetProxyConnection(socks5 string, host string) (net.Conn, error)

GetProxyConnection return the proxy connection

func (*DefaultProbe) Interval added in v1.6.0

func (d *DefaultProbe) Interval() time.Duration

Interval get the probe interval

func (*DefaultProbe) Kind added in v1.6.0

func (d *DefaultProbe) Kind() string

Kind return the probe kind

func (*DefaultProbe) LogTitle added in v1.9.0

func (d *DefaultProbe) LogTitle() string

LogTitle return the log title

func (*DefaultProbe) Name added in v1.6.0

func (d *DefaultProbe) Name() string

Name return the probe name

func (*DefaultProbe) Probe added in v1.6.0

func (d *DefaultProbe) Probe() probe.Result

Probe return the checking result

func (*DefaultProbe) Result added in v1.6.0

func (d *DefaultProbe) Result() *probe.Result

Result get the probe result

func (*DefaultProbe) Timeout added in v1.6.0

func (d *DefaultProbe) Timeout() time.Duration

Timeout get the probe timeout

type ProbeFuncType

type ProbeFuncType func() (bool, string)

ProbeFuncType is the probe function type

Jump to

Keyboard shortcuts

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