net

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoDetectProtocol added in v0.1.2

func AutoDetectProtocol(inputURL string) string

func GetSSLCertExpiry

func GetSSLCertExpiry(siteURL string) int

func TryHTTPSConnection added in v0.1.2

func TryHTTPSConnection(urlString string) (*http.Response, error)

Types

type HTTPRequestOptions added in v0.1.8

type HTTPRequestOptions struct {
	Method  string
	Headers map[string]string
	Body    string
}

type HTTPResponse added in v0.1.8

type HTTPResponse struct {
	URL             string
	ResolvedIP      string
	StatusCode      int
	StatusText      string
	HTTPVersion     string
	ResponseHeaders http.Header
	ResponseBody    string
	RequestHeaders  http.Header
	RequestBody     string
	Method          string
	ResponseTime    time.Duration
	TraceInfo       *HttpTraceInfo
	LastCheckTime   time.Time
	Error           error
}

type HttpTraceInfo

type HttpTraceInfo struct {
	Wait             time.Duration
	DNSLookup        time.Duration
	TCPConnection    time.Duration
	TimeToFirstByte  time.Duration
	DownloadDuration time.Duration
}

type NetworkConfig added in v0.0.7

type NetworkConfig struct {
	Timeout         time.Duration
	ShouldFail      bool
	FollowRedirects bool
	AcceptRedirects bool
	SkipSSL         bool
	AssertText      string
	Headers         []string
	Method          string
	Body            string
}

type WebsiteCheckResult added in v0.0.7

type WebsiteCheckResult struct {
	URL             string
	ResolvedIP      string
	IsUp            bool
	StatusCode      int
	ResponseTime    time.Duration
	TraceInfo       *HttpTraceInfo
	AssertionPassed bool
	LastCheckTime   time.Time
	AssertText      string
	Method          string
	RequestHeaders  http.Header
	ResponseHeaders http.Header
	RequestBody     string
	ResponseBody    string
}

func CheckWebsite

func CheckWebsite(urlStr string, config NetworkConfig) WebsiteCheckResult

Jump to

Keyboard shortcuts

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