status

package
v0.0.0-...-c5d5a31 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package status checks if a website is down

Index

Constants

View Source
const IsItUpProvider provider = "Is it up?"

IsItUpProvider indicates the source is isitup.org

Variables

This section is empty.

Functions

func FixDomain

func FixDomain(domain string) string

FixDomain appends .com to a string if there is no tld

Types

type Fetcher

type Fetcher interface {
	Fetch(domain string) (*Response, error)
}

Fetcher implements methods to check for checking a website status

type IsItUp

type IsItUp struct {
	HTTPClient *http.Client
}

IsItUp holds settings for the isitup.org API

func (*IsItUp) Fetch

func (u *IsItUp) Fetch(domain string) (*Response, error)

Fetch retrieves security breaches from haveibeenpwned.com

type Response

type Response struct {
	Domain   string  `json:"domain"`
	Port     int     `json:"port"`
	Status   int     `json:"status_code"`
	IP       string  `json:"response_ip"`
	Code     int     `json:"response_code"`
	Time     float64 `json:"response_time"`
	Provider provider
}

Response is a status response

Jump to

Keyboard shortcuts

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