check

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Check

type Check interface {
	GetType() Type
	Check() Result
}

func NewHttpCheck

func NewHttpCheck(url string, expectedStatusCode *int, certificateWarningDelta time.Duration) Check

func NewIcmpCheck

func NewIcmpCheck(addr string) Check

func NewTcpCheck

func NewTcpCheck(addr string) Check

func NewTlsCheck

func NewTlsCheck(url string, tlsConfig *tls.Config) Check

type HttpCheck

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

func (HttpCheck) Check

func (h HttpCheck) Check() Result

func (HttpCheck) GetType

func (h HttpCheck) GetType() Type

type HttpStatistics

type HttpStatistics struct {
	TimeTaken     time.Duration
	StatusCode    int
	Headers       map[string][]string
	ContentLength int64
}

func (HttpStatistics) GetTimeTaken

func (i HttpStatistics) GetTimeTaken() time.Duration

type IcmpCheck

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

func (IcmpCheck) Check

func (h IcmpCheck) Check() (result Result)

func (IcmpCheck) GetType

func (h IcmpCheck) GetType() Type

type IcmpStatistics

type IcmpStatistics struct {
	TimeTaken      time.Duration
	PingStatistics *ping.Statistics
}

func (IcmpStatistics) GetTimeTaken

func (i IcmpStatistics) GetTimeTaken() time.Duration

type PeerCertificate

type PeerCertificate struct {
	Content []byte
}

type Result

type Result struct {
	Error      error
	Message    string
	Warnings   []Warning
	Statistics Statistics
}

type Statistics

type Statistics interface {
	GetTimeTaken() time.Duration
}

type TcpCheck

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

func (TcpCheck) Check

func (h TcpCheck) Check() Result

func (TcpCheck) GetType

func (h TcpCheck) GetType() Type

type TcpStatistics

type TcpStatistics struct {
	TimeTaken  time.Duration
	RemoteAddr string
}

func (TcpStatistics) GetTimeTaken

func (i TcpStatistics) GetTimeTaken() time.Duration

type TlsCheck

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

func (TlsCheck) Check

func (h TlsCheck) Check() Result

func (TlsCheck) GetType

func (h TlsCheck) GetType() Type

type TlsStatistics

type TlsStatistics struct {
	TimeTaken        time.Duration
	PeerCertificates []PeerCertificate
}

func (TlsStatistics) GetTimeTaken

func (i TlsStatistics) GetTimeTaken() time.Duration

type Type

type Type string
const (
	HttpType Type = "http"
	IcmpType Type = "icmp"
	TcpType  Type = "tcp"
	TlsType  Type = "tls"
)

type Warning

type Warning struct {
	Message string
}

Jump to

Keyboard shortcuts

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