checkers

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CertInfo

type CertInfo struct {
	ExpiresAt time.Time
	IssuedBy  string
	IssuedFor []string
}

type CheckResult

type CheckResult struct {
	Error        error
	Metadata     map[string]interface{}
	ResponseTime time.Duration
	Success      bool
}

type Checker

type Checker interface {
	Check(ctx context.Context, address string) CheckResult
	Protocol() Protocol
}

func NewChecker

func NewChecker(protocol Protocol) (Checker, error)

type DNSChecker

type DNSChecker struct{}

func NewDNSChecker

func NewDNSChecker() *DNSChecker

func (*DNSChecker) Check

func (c *DNSChecker) Check(ctx context.Context, address string) CheckResult

func (*DNSChecker) Protocol

func (c *DNSChecker) Protocol() Protocol

type HTTPChecker

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

func NewHTTPChecker

func NewHTTPChecker() *HTTPChecker

func (*HTTPChecker) Check

func (c *HTTPChecker) Check(ctx context.Context, address string) CheckResult

func (*HTTPChecker) Protocol

func (c *HTTPChecker) Protocol() Protocol

type HTTPSChecker

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

func NewHTTPSChecker

func NewHTTPSChecker() *HTTPSChecker

func (*HTTPSChecker) Check

func (c *HTTPSChecker) Check(ctx context.Context, address string) CheckResult

func (*HTTPSChecker) Protocol

func (c *HTTPSChecker) Protocol() Protocol

type HTTPSResult

type HTTPSResult struct {
	CheckResult
	Certificate *CertInfo
}

type Protocol

type Protocol string
const (
	TCP   Protocol = "TCP"
	HTTP  Protocol = "HTTP"
	HTTPS Protocol = "HTTPS"
	SMTP  Protocol = "SMTP"
	DNS   Protocol = "DNS"
)

type SMTPChecker

type SMTPChecker struct{}

func NewSMTPChecker

func NewSMTPChecker() *SMTPChecker

func (*SMTPChecker) Check

func (c *SMTPChecker) Check(ctx context.Context, address string) CheckResult

func (*SMTPChecker) Protocol

func (c *SMTPChecker) Protocol() Protocol

type TCPChecker

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

func NewTCPChecker

func NewTCPChecker() *TCPChecker

func (*TCPChecker) Check

func (c *TCPChecker) Check(ctx context.Context, address string) CheckResult

func (*TCPChecker) Protocol

func (c *TCPChecker) Protocol() Protocol

Jump to

Keyboard shortcuts

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