diag

package
v0.0.0-...-07f1eb8 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package diag implements network diagnostics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EvalResult

type EvalResult struct {
	Name     string
	Error    bool
	Status   string
	Children []*EvalResult
}

type Monitor

type Monitor struct {
	// contains filtered or unexported fields
}

func NewMonitor

func NewMonitor(n Node) *Monitor

func (*Monitor) Evaluate

func (m *Monitor) Evaluate() *EvalResult

type Node

type Node interface {
	Then(t Node) Node
	Children() []Node
	Evaluate() (status string, _ error)
}

func DHCPv4

func DHCPv4() Node

DHCPv4 returns a Node which succeeds if /perm/dhcp4/wire/lease.json contains a non-expired DHCPv4 lease.

func DHCPv6

func DHCPv6() Node

DHCPv6 returns a Node which succeeds if /perm/dhcp6/wire/lease.json contains a non-expired DHCPv6 lease.

func Link(ifname string) Node

Link returns a Node which succeeds when the specified network interface is in state UP and RUNNING.

func Ping4

func Ping4(addr string) Node

Ping4 returns a Node which succeeds when the specified address responds to an ICMPv4 ping.

func Ping4Gateway

func Ping4Gateway() Node

Ping4Gateway returns a Node which succeeds when the default gateway responds to an ICMPv4 ping.

func Ping6

func Ping6(ifname, addr string) Node

Ping6 returns a Node which succeeds when the specified address responds to an ICMPv6 ping.

func Ping6Gateway

func Ping6Gateway() Node

Ping6Gateway returns a Node which succeeds when the default gateway responds to an ICMPv6 ping.

func RouterAdvertisments

func RouterAdvertisments(ifname string) Node

RouterAdvertisments returns a Node which succeeds if the specified interface obtained at least one address from IPv6 router advertisments.

func TCP4

func TCP4(addr string) Node

TCP4 returns a Node which succeeds when the specified address accepts a TCPv4 connection.

func TCP6

func TCP6(ifname, addr string) Node

TCP6 returns a Node which succeeds when the specified address accepts a TCPv6 connection.

Jump to

Keyboard shortcuts

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