Documentation ¶
Overview ¶
Package dialtesting defined dialtesting tasks and task implements.
Index ¶
- Constants
- type DialResult
- type HTTPAdvanceOption
- type HTTPOptAuth
- type HTTPOptBody
- type HTTPOptCertificate
- type HTTPOptProxy
- type HTTPOptRequest
- type HTTPSecret
- type HTTPSuccess
- type HTTPTask
- func (t *HTTPTask) AccessKey() string
- func (t *HTTPTask) Check() error
- func (t *HTTPTask) CheckResult() (reasons []string, succFlag bool)
- func (t *HTTPTask) Class() string
- func (t *HTTPTask) Clear()
- func (t *HTTPTask) GetFrequency() string
- func (t *HTTPTask) GetHostName() (string, error)
- func (t *HTTPTask) GetLineData() string
- func (t *HTTPTask) GetOwnerExternalID() string
- func (t *HTTPTask) GetResults() (tags map[string]string, fields map[string]interface{})
- func (t *HTTPTask) GetTagsInfo() string
- func (t *HTTPTask) GetWorkspaceLanguage() string
- func (t *HTTPTask) ID() string
- func (t *HTTPTask) Init() error
- func (t *HTTPTask) InitDebug() error
- func (t *HTTPTask) MetricName() string
- func (t *HTTPTask) PostURLStr() string
- func (t *HTTPTask) RegionName() string
- func (t *HTTPTask) Run() error
- func (t *HTTPTask) SetAk(ak string)
- func (t *HTTPTask) SetOwnerExternalID(exid string)
- func (t *HTTPTask) SetRegionID(regionID string)
- func (t *HTTPTask) SetStatus(status string)
- func (t *HTTPTask) SetUpdateTime(ts int64)
- func (t *HTTPTask) Status() string
- func (t *HTTPTask) Stop() error
- func (t *HTTPTask) Ticker() *time.Ticker
- func (t *HTTPTask) UpdateTimeUs() int64
- type ICMP
- type ICMPSuccess
- type ICMPTask
- func (t *ICMPTask) AccessKey() string
- func (t *ICMPTask) Check() error
- func (t *ICMPTask) CheckResult() (reasons []string, succFlag bool)
- func (t *ICMPTask) CheckSum(data []byte) (rt uint16)
- func (t *ICMPTask) Class() string
- func (t *ICMPTask) Clear()
- func (t *ICMPTask) GetFrequency() string
- func (t *ICMPTask) GetHostName() (string, error)
- func (t *ICMPTask) GetLineData() string
- func (t *ICMPTask) GetOwnerExternalID() string
- func (t *ICMPTask) GetResults() (tags map[string]string, fields map[string]interface{})
- func (t *ICMPTask) GetTagsInfo() string
- func (t *ICMPTask) GetWorkspaceLanguage() string
- func (t *ICMPTask) ID() string
- func (t *ICMPTask) Init() error
- func (t *ICMPTask) InitDebug() error
- func (t *ICMPTask) MetricName() string
- func (t *ICMPTask) PostURLStr() string
- func (t *ICMPTask) RegionName() string
- func (t *ICMPTask) Run() error
- func (t *ICMPTask) SetAk(ak string)
- func (t *ICMPTask) SetOwnerExternalID(exid string)
- func (t *ICMPTask) SetRegionID(regionID string)
- func (t *ICMPTask) SetStatus(status string)
- func (t *ICMPTask) SetUpdateTime(ts int64)
- func (t *ICMPTask) Status() string
- func (t *ICMPTask) Stop() error
- func (t *ICMPTask) Ticker() *time.Ticker
- func (t *ICMPTask) UpdateTimeUs() int64
- type Packet
- type Response
- type ResponseTimeSucess
- type Route
- type RouteItem
- type SuccessOption
- type TCPResponseTime
- type TCPSuccess
- type TCPTask
- func (t *TCPTask) AccessKey() string
- func (t *TCPTask) Check() error
- func (t *TCPTask) CheckResult() (reasons []string, succFlag bool)
- func (t *TCPTask) Class() string
- func (t *TCPTask) Clear()
- func (t *TCPTask) GetFrequency() string
- func (t *TCPTask) GetHostName() (string, error)
- func (t *TCPTask) GetLineData() string
- func (t *TCPTask) GetOwnerExternalID() string
- func (t *TCPTask) GetResults() (tags map[string]string, fields map[string]interface{})
- func (t *TCPTask) GetTagsInfo() string
- func (t *TCPTask) GetWorkspaceLanguage() string
- func (t *TCPTask) ID() string
- func (t *TCPTask) Init() error
- func (t *TCPTask) InitDebug() error
- func (t *TCPTask) MetricName() string
- func (t *TCPTask) PostURLStr() string
- func (t *TCPTask) RegionName() string
- func (t *TCPTask) Run() error
- func (t *TCPTask) SetAk(ak string)
- func (t *TCPTask) SetOwnerExternalID(exid string)
- func (t *TCPTask) SetRegionID(regionID string)
- func (t *TCPTask) SetStatus(status string)
- func (t *TCPTask) SetUpdateTime(ts int64)
- func (t *TCPTask) Status() string
- func (t *TCPTask) Stop() error
- func (t *TCPTask) Ticker() *time.Ticker
- func (t *TCPTask) UpdateTimeUs() int64
- type Task
- type Traceroute
- type TracerouteOption
- type ValueSuccess
- type WebsocketAdvanceOption
- type WebsocketOptAuth
- type WebsocketOptRequest
- type WebsocketResponseTime
- type WebsocketSuccess
- type WebsocketTask
- func (t *WebsocketTask) AccessKey() string
- func (t *WebsocketTask) Check() error
- func (t *WebsocketTask) CheckResult() (reasons []string, succFlag bool)
- func (t *WebsocketTask) Class() string
- func (t *WebsocketTask) Clear()
- func (t *WebsocketTask) GetFrequency() string
- func (t *WebsocketTask) GetHostName() (string, error)
- func (t *WebsocketTask) GetLineData() string
- func (t *WebsocketTask) GetOwnerExternalID() string
- func (t *WebsocketTask) GetResults() (tags map[string]string, fields map[string]interface{})
- func (t *WebsocketTask) GetTagsInfo() string
- func (t *WebsocketTask) GetWorkspaceLanguage() string
- func (t *WebsocketTask) ID() string
- func (t *WebsocketTask) Init() error
- func (t *WebsocketTask) InitDebug() error
- func (t *WebsocketTask) MetricName() string
- func (t *WebsocketTask) PostURLStr() string
- func (t *WebsocketTask) RegionName() string
- func (t *WebsocketTask) Run() error
- func (t *WebsocketTask) SetAk(ak string)
- func (t *WebsocketTask) SetOwnerExternalID(exid string)
- func (t *WebsocketTask) SetRegionID(regionID string)
- func (t *WebsocketTask) SetStatus(status string)
- func (t *WebsocketTask) SetUpdateTime(ts int64)
- func (t *WebsocketTask) Status() string
- func (t *WebsocketTask) Stop() error
- func (t *WebsocketTask) Ticker() *time.Ticker
- func (t *WebsocketTask) UpdateTimeUs() int64
Constants ¶
View Source
const ( StatusStop = "stop" ClassHTTP = "HTTP" ClassTCP = "TCP" ClassWebsocket = "WEBSOCKET" ClassICMP = "ICMP" ClassDNS = "DNS" ClassHeadless = "BROWSER" ClassOther = "OTHER" )
View Source
const ( MaxTimeout = 10 * time.Second MaxHops = 60 MaxRetry = 3 )
View Source
const MaxMsgSize = 15 * 1024 * 1024
View Source
const (
PingTimeout = 3 * time.Second
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DialResult ¶
type HTTPAdvanceOption ¶
type HTTPAdvanceOption struct { RequestOptions *HTTPOptRequest `json:"request_options,omitempty"` RequestBody *HTTPOptBody `json:"request_body,omitempty"` Certificate *HTTPOptCertificate `json:"certificate,omitempty"` Proxy *HTTPOptProxy `json:"proxy,omitempty"` Secret *HTTPSecret `json:"secret,omitempty"` RequestTimeout string `json:"request_timeout,omitempty"` }
type HTTPOptAuth ¶
type HTTPOptBody ¶
type HTTPOptCertificate ¶
type HTTPOptProxy ¶
type HTTPOptRequest ¶
type HTTPOptRequest struct { FollowRedirect bool `json:"follow_redirect,omitempty"` Headers map[string]string `json:"headers,omitempty"` Cookies string `json:"cookies,omitempty"` Auth *HTTPOptAuth `json:"auth,omitempty"` }
type HTTPSecret ¶
type HTTPSecret struct {
NoSaveResponseBody bool `json:"not_save,omitempty"`
}
type HTTPSuccess ¶
type HTTPSuccess struct { Body []*SuccessOption `json:"body,omitempty"` ResponseTime string `json:"response_time,omitempty"` Header map[string][]*SuccessOption `json:"header,omitempty"` StatusCode []*SuccessOption `json:"status_code,omitempty"` // contains filtered or unexported fields }
type HTTPTask ¶
type HTTPTask struct { ExternalID string `json:"external_id"` Name string `json:"name"` AK string `json:"access_key"` Method string `json:"method"` URL string `json:"url"` PostURL string `json:"post_url"` CurStatus string `json:"status"` Frequency string `json:"frequency"` Region string `json:"region"` // 冗余进来,便于调试 OwnerExternalID string `json:"owner_external_id"` SuccessWhenLogic string `json:"success_when_logic"` SuccessWhen []*HTTPSuccess `json:"success_when"` Tags map[string]string `json:"tags,omitempty"` Labels []string `json:"labels,omitempty"` WorkspaceLanguage string `json:"workspace_language,omitempty"` TagsInfo string `json:"tags_info,omitempty"` AdvanceOptions *HTTPAdvanceOption `json:"advance_options,omitempty"` UpdateTime int64 `json:"update_time,omitempty"` Option map[string]string // contains filtered or unexported fields }
func (*HTTPTask) CheckResult ¶
func (*HTTPTask) GetFrequency ¶
func (*HTTPTask) GetHostName ¶ added in v1.1.12
func (*HTTPTask) GetLineData ¶
func (*HTTPTask) GetOwnerExternalID ¶
func (*HTTPTask) GetResults ¶
func (*HTTPTask) GetTagsInfo ¶ added in v1.1.21
func (*HTTPTask) GetWorkspaceLanguage ¶ added in v1.1.21
func (*HTTPTask) MetricName ¶
func (*HTTPTask) PostURLStr ¶
func (*HTTPTask) RegionName ¶
func (*HTTPTask) SetOwnerExternalID ¶
func (*HTTPTask) SetRegionID ¶
func (*HTTPTask) SetUpdateTime ¶
func (*HTTPTask) UpdateTimeUs ¶
type ICMPSuccess ¶
type ICMPSuccess struct { PacketLossPercent []*ValueSuccess `json:"packet_loss_percent,omitempty"` ResponseTime []*ResponseTimeSucess `json:"response_time,omitempty"` Hops []*ValueSuccess `json:"hops,omitempty"` Packets []*ValueSuccess `json:"packets,omitempty"` }
type ICMPTask ¶
type ICMPTask struct { Host string `json:"host"` PacketCount int `json:"packet_count"` Timeout string `json:"timeout"` EnableTraceroute bool `json:"enable_traceroute"` TracerouteConfig *TracerouteOption `json:"traceroute_config"` SuccessWhen []*ICMPSuccess `json:"success_when"` SuccessWhenLogic string `json:"success_when_logic"` ExternalID string `json:"external_id"` Name string `json:"name"` AK string `json:"access_key"` PostURL string `json:"post_url"` CurStatus string `json:"status"` Frequency string `json:"frequency"` Region string `json:"region"` OwnerExternalID string `json:"owner_external_id"` Tags map[string]string `json:"tags,omitempty"` Labels []string `json:"labels,omitempty"` UpdateTime int64 `json:"update_time,omitempty"` WorkspaceLanguage string `json:"workspace_language,omitempty"` TagsInfo string `json:"tags_info,omitempty"` // contains filtered or unexported fields }
func (*ICMPTask) CheckResult ¶
func (*ICMPTask) GetFrequency ¶
func (*ICMPTask) GetHostName ¶ added in v1.1.12
func (*ICMPTask) GetLineData ¶
func (*ICMPTask) GetOwnerExternalID ¶
func (*ICMPTask) GetResults ¶
func (*ICMPTask) GetTagsInfo ¶ added in v1.1.21
func (*ICMPTask) GetWorkspaceLanguage ¶ added in v1.1.21
func (*ICMPTask) MetricName ¶
func (*ICMPTask) PostURLStr ¶
func (*ICMPTask) RegionName ¶
func (*ICMPTask) SetOwnerExternalID ¶
func (*ICMPTask) SetRegionID ¶
func (*ICMPTask) SetUpdateTime ¶
func (*ICMPTask) UpdateTimeUs ¶
type Response ¶
type Response struct { From net.IP ResponseTime time.Duration // contains filtered or unexported fields }
Response for sent packet, may be failed response when timeout.
type ResponseTimeSucess ¶
type Route ¶
type Route struct { Total int `json:"total"` Failed int `json:"failed"` Loss float64 `json:"loss"` AvgCost float64 `json:"avg_cost"` MinCost float64 `json:"min_cost"` MaxCost float64 `json:"max_cost"` StdCost float64 `json:"std_cost"` Items []*RouteItem `json:"items"` }
Route is summary for each hop.
func TracerouteIP ¶
func TracerouteIP(ip string, opt *TracerouteOption) (routes []*Route, err error)
type SuccessOption ¶
type SuccessOption struct { Is string `json:"is,omitempty"` IsNot string `json:"is_not,omitempty"` MatchRegex string `json:"match_regex,omitempty"` NotMatchRegex string `json:"not_match_regex,omitempty"` Contains string `json:"contains,omitempty"` NotContains string `json:"not_contains,omitempty"` // contains filtered or unexported fields }
type TCPResponseTime ¶
type TCPSuccess ¶
type TCPSuccess struct { ResponseTime []*TCPResponseTime `json:"response_time,omitempty"` Hops []*ValueSuccess `json:"hops,omitempty"` ResponseMessage []*SuccessOption `json:"response_message,omitempty"` }
type TCPTask ¶
type TCPTask struct { Host string `json:"host"` Port string `json:"port"` Message string `json:"message"` Timeout string `json:"timeout"` EnableTraceroute bool `json:"enable_traceroute"` TracerouteConfig *TracerouteOption `json:"traceroute_config"` SuccessWhen []*TCPSuccess `json:"success_when"` SuccessWhenLogic string `json:"success_when_logic"` ExternalID string `json:"external_id"` Name string `json:"name"` AK string `json:"access_key"` PostURL string `json:"post_url"` CurStatus string `json:"status"` Frequency string `json:"frequency"` Region string `json:"region"` OwnerExternalID string `json:"owner_external_id"` Tags map[string]string `json:"tags,omitempty"` Labels []string `json:"labels,omitempty"` UpdateTime int64 `json:"update_time,omitempty"` WorkspaceLanguage string `json:"workspace_language,omitempty"` TagsInfo string `json:"tags_info,omitempty"` // contains filtered or unexported fields }
func (*TCPTask) CheckResult ¶
func (*TCPTask) GetFrequency ¶
func (*TCPTask) GetHostName ¶ added in v1.1.12
func (*TCPTask) GetLineData ¶
func (*TCPTask) GetOwnerExternalID ¶
func (*TCPTask) GetResults ¶
func (*TCPTask) GetTagsInfo ¶ added in v1.1.21
func (*TCPTask) GetWorkspaceLanguage ¶ added in v1.1.21
func (*TCPTask) MetricName ¶
func (*TCPTask) PostURLStr ¶
func (*TCPTask) RegionName ¶
func (*TCPTask) SetOwnerExternalID ¶
func (*TCPTask) SetRegionID ¶
func (*TCPTask) SetUpdateTime ¶
func (*TCPTask) UpdateTimeUs ¶
type Task ¶
type Task interface { ID() string Status() string Run() error Init() error InitDebug() error CheckResult() ([]string, bool) Class() string GetResults() (map[string]string, map[string]interface{}) PostURLStr() string MetricName() string Stop() error RegionName() string AccessKey() string Check() error UpdateTimeUs() int64 GetFrequency() string GetOwnerExternalID() string SetOwnerExternalID(string) GetLineData() string GetHostName() (string, error) GetWorkspaceLanguage() string GetTagsInfo() string SetRegionID(string) SetAk(string) SetStatus(string) SetUpdateTime(int64) Ticker() *time.Ticker }
type Traceroute ¶
type Traceroute struct { Host string Hops int Retry int Timeout time.Duration // contains filtered or unexported fields }
Traceroute specified host with max hops and timeout.
func (*Traceroute) Run ¶
func (t *Traceroute) Run() error
type TracerouteOption ¶
type TracerouteOption struct { Hops int Retry int Timeout string // contains filtered or unexported fields }
TracerouteOption represent traceroute option.
type ValueSuccess ¶
type WebsocketAdvanceOption ¶
type WebsocketAdvanceOption struct { RequestOptions *WebsocketOptRequest `json:"request_options,omitempty"` Auth *WebsocketOptAuth `json:"auth,omitempty"` }
type WebsocketOptAuth ¶
type WebsocketOptRequest ¶
type WebsocketResponseTime ¶
type WebsocketSuccess ¶
type WebsocketSuccess struct { ResponseTime []*WebsocketResponseTime `json:"response_time,omitempty"` ResponseMessage []*SuccessOption `json:"response_message,omitempty"` Header map[string][]*SuccessOption `json:"header,omitempty"` }
type WebsocketTask ¶
type WebsocketTask struct { URL string `json:"url"` Message string `json:"message"` SuccessWhen []*WebsocketSuccess `json:"success_when"` AdvanceOptions *WebsocketAdvanceOption `json:"advance_options,omitempty"` SuccessWhenLogic string `json:"success_when_logic"` ExternalID string `json:"external_id"` Name string `json:"name"` AK string `json:"access_key"` PostURL string `json:"post_url"` CurStatus string `json:"status"` Frequency string `json:"frequency"` Region string `json:"region"` OwnerExternalID string `json:"owner_external_id"` Tags map[string]string `json:"tags,omitempty"` Labels []string `json:"labels,omitempty"` UpdateTime int64 `json:"update_time,omitempty"` WorkspaceLanguage string `json:"workspace_language,omitempty"` TagsInfo string `json:"tags_info,omitempty"` // contains filtered or unexported fields }
func (*WebsocketTask) AccessKey ¶
func (t *WebsocketTask) AccessKey() string
func (*WebsocketTask) Check ¶
func (t *WebsocketTask) Check() error
func (*WebsocketTask) CheckResult ¶
func (t *WebsocketTask) CheckResult() (reasons []string, succFlag bool)
func (*WebsocketTask) Class ¶
func (t *WebsocketTask) Class() string
func (*WebsocketTask) Clear ¶
func (t *WebsocketTask) Clear()
func (*WebsocketTask) GetFrequency ¶
func (t *WebsocketTask) GetFrequency() string
func (*WebsocketTask) GetHostName ¶ added in v1.1.12
func (t *WebsocketTask) GetHostName() (string, error)
func (*WebsocketTask) GetLineData ¶
func (t *WebsocketTask) GetLineData() string
func (*WebsocketTask) GetOwnerExternalID ¶
func (t *WebsocketTask) GetOwnerExternalID() string
func (*WebsocketTask) GetResults ¶
func (t *WebsocketTask) GetResults() (tags map[string]string, fields map[string]interface{})
func (*WebsocketTask) GetTagsInfo ¶ added in v1.1.21
func (t *WebsocketTask) GetTagsInfo() string
func (*WebsocketTask) GetWorkspaceLanguage ¶ added in v1.1.21
func (t *WebsocketTask) GetWorkspaceLanguage() string
func (*WebsocketTask) ID ¶
func (t *WebsocketTask) ID() string
func (*WebsocketTask) Init ¶
func (t *WebsocketTask) Init() error
func (*WebsocketTask) InitDebug ¶
func (t *WebsocketTask) InitDebug() error
func (*WebsocketTask) MetricName ¶
func (t *WebsocketTask) MetricName() string
func (*WebsocketTask) PostURLStr ¶
func (t *WebsocketTask) PostURLStr() string
func (*WebsocketTask) RegionName ¶
func (t *WebsocketTask) RegionName() string
func (*WebsocketTask) Run ¶
func (t *WebsocketTask) Run() error
func (*WebsocketTask) SetAk ¶
func (t *WebsocketTask) SetAk(ak string)
func (*WebsocketTask) SetOwnerExternalID ¶
func (t *WebsocketTask) SetOwnerExternalID(exid string)
func (*WebsocketTask) SetRegionID ¶
func (t *WebsocketTask) SetRegionID(regionID string)
func (*WebsocketTask) SetStatus ¶
func (t *WebsocketTask) SetStatus(status string)
func (*WebsocketTask) SetUpdateTime ¶
func (t *WebsocketTask) SetUpdateTime(ts int64)
func (*WebsocketTask) Status ¶
func (t *WebsocketTask) Status() string
func (*WebsocketTask) Stop ¶
func (t *WebsocketTask) Stop() error
func (*WebsocketTask) Ticker ¶
func (t *WebsocketTask) Ticker() *time.Ticker
func (*WebsocketTask) UpdateTimeUs ¶
func (t *WebsocketTask) UpdateTimeUs() int64
Click to show internal directories.
Click to hide internal directories.