probe

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

README

Executors

Documentation

How to write an Executor ?

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIPsFromHostname added in v0.6.0

func GetIPsFromHostname(host string, ipv int) ([]string, error)

GetIPsFromHostname returns a array of IPs resolved by a Hostname Ipv4 or Ipv6 This func must be divided WIP

func GetIPsWithPort added in v0.6.0

func GetIPsWithPort(host string, port int, ipv int) ([]string, error)

func ToMap

func ToMap(proberes interface{}) (map[string]interface{}, error)

Types

type Probe

type Probe interface {
	// Start run a Step TStep
	Run(timeout time.Duration) []ProbeReturn
	GetName() string
	Initialize(StepProbe) error
	GenerateTStepName() string
	GetDefaultTimeout() time.Duration
	GetDefaultFrequency() time.Duration
}

Probe execute a testStep.

type ProbeAnswer added in v0.7.0

type ProbeAnswer map[string]interface{}

type ProbeDuration added in v0.5.0

type ProbeDuration struct {
	time.Duration
}

func (ProbeDuration) MarshalJSON added in v0.5.0

func (d ProbeDuration) MarshalJSON() ([]byte, error)

type ProbeInfo

type ProbeInfo struct {
	Error        string        `json:"error"`
	Status       Status        `json:"status"`
	ProbeCode    int           `json:"probecode"`
	ResponseTime time.Duration `json:"responsetime"`
	SubTest      string        `json:"subtest"`
}

ProbeInfo details DO NOT EDIT

func (ProbeInfo) MarshalJSON added in v0.5.0

func (pi ProbeInfo) MarshalJSON() ([]byte, error)

type ProbeReturn

type ProbeReturn struct {
	ProbeInfo ProbeInfo
	Answer    ProbeAnswer
}

ProbeReturn represents an probe result on a test step

type Status

type Status int
const (
	Success Status = 1  // Success
	Timeout Status = -2 // The probe request encountered a timeout
	Error   Status = -3 // The probe request encountered a error (can be considered as a desired state)
	Failure Status = -4 // The probe cannot create the request nor send it
)

type StepProbe

type StepProbe map[string]interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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