Documentation
¶
Index ¶
Constants ¶
View Source
const AWSProvider = "aws"
View Source
const GCPProvider = "gcp"
Variables ¶
This section is empty.
Functions ¶
func AddTarget ¶
func AddTarget(t ...*RegionTarget)
Types ¶
type HTTPRequester ¶
HTTPRequester is an interface for HTTP requests
type PingResult ¶
type PingResult struct { Err error Target RegionTarget Pings []int }
type Pinger ¶
type Pinger struct {
// contains filtered or unexported fields
}
func (*Pinger) AddTarget ¶
func (p *Pinger) AddTarget(targets ...*RegionTarget)
func (*Pinger) Results ¶
func (p *Pinger) Results() []PingResult
type RegionTarget ¶
func GetAllTargets ¶
func GetAllTargets() []*RegionTarget
func NewRegionTarget ¶
func NewRegionTarget(provider, regionName, regionCodeName, host string) *RegionTarget
func (*RegionTarget) GetIP ¶
func (t *RegionTarget) GetIP() (*net.TCPAddr, error)
GetIP return IP for target
func (*RegionTarget) GetURL ¶
func (t *RegionTarget) GetURL() string
GetURL return HTTP URL for target
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request implements Requester interface
type RequestType ¶
type RequestType int
RequestType describes a type for a request type
const ( // RequestTypeHTTP is HTTP type of request RequestTypeHTTP RequestType = iota // RequestTypeTCP is TCP type of request RequestTypeTCP )
type Requester ¶
type Requester interface {
Do(ua, url string, reqType RequestType) (time.Duration, error)
}
Requester is an interface to do a network request
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
A Runner waits for a collection of goroutines to finish. It's wrapper around the waitgroup struct to add concurrency limit.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.