proxymon

package module
v0.0.0-...-82f61c8 Latest Latest
Warning

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

Go to latest
Published: May 23, 2021 License: MIT Imports: 11 Imported by: 0

README

proxymon

A package to monitor the health and provide internet connection metrics of socks and http proxies.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	PingInterval          time.Duration
	DeadExpiry            time.Duration
	BandwidthTestInterval time.Duration
	ConcurrencyLevel      int
}

type Delegate

type Delegate interface {
	HandleAdd(n Node)
	HandleDead(n Node)
	HandleRemove(n Node)
	HandleUpdate(n Node)
}

type Metrics

type Metrics struct {
	Upload   float64
	Download float64
	Ping     time.Duration

	SuccessfulPings int
	FailedPings     int
	LastSeen        time.Time
}

func (*Metrics) Merge

func (m *Metrics) Merge(res speedtest.Result)

func (*Metrics) Uptime

func (m *Metrics) Uptime() float64

type Monitor

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

func NewMonitor

func NewMonitor(c Config, d Delegate) Monitor

func (*Monitor) Add

func (m *Monitor) Add(p Proxy)

func (*Monitor) Nodes

func (m *Monitor) Nodes() []Node

type Node

type Node struct {
	Proxy
	Metrics
}

type Proxy

type Proxy struct {
	Protocol string
	Username string
	Password string
	Host     string
}

func ParseProxyString

func ParseProxyString(s string) (Proxy, error)

func (*Proxy) ToUri

func (p *Proxy) ToUri() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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