Feature: add delay history and improve url-test behavior

This commit is contained in:
Dreamacro
2019-03-17 14:52:39 +08:00
parent 63446da5fa
commit 7a9d986ff3
5 changed files with 151 additions and 7 deletions

View File

@ -2,6 +2,7 @@ package constant
import (
"net"
"time"
)
// Adapter Type
@ -31,10 +32,17 @@ type ProxyAdapter interface {
MarshalJSON() ([]byte, error)
}
type DelayHistory struct {
Time time.Time `json:"time"`
Delay uint16 `json:"delay"`
}
type Proxy interface {
ProxyAdapter
Alive() bool
URLTest(url string) (int16, error)
DelayHistory() []DelayHistory
LastDelay() uint16
URLTest(url string) (uint16, error)
}
// AdapterType is enum of adapter type