Documentation
¶
Index ¶
- func CloudflaredPath() string
- func EnsureCloudflared() (string, error)
- func PID() int
- func Running() bool
- func Start(token string) error
- func StartQuick(port string) error
- func StartQuickWithAuth(port, username, password string) error
- func Stop() error
- type APICheck
- type CloudflaredCheck
- type DiagnoseResult
- type RouteDiagnose
- type RouteInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureCloudflared ¶
EnsureCloudflared 确保 cloudflared 已安装,未安装则自动下载
func StartQuickWithAuth ¶ added in v0.6.0
StartQuickWithAuth 启动带鉴权代理的免域名模式
Types ¶
type APICheck ¶ added in v0.8.0
type APICheck struct {
Reachable bool `json:"reachable"`
LatencyMS int64 `json:"latency_ms,omitempty"`
Err string `json:"err,omitempty"`
}
APICheck Cloudflare API 连通性
type CloudflaredCheck ¶ added in v0.8.0
type CloudflaredCheck struct {
Installed bool `json:"installed"`
Path string `json:"path,omitempty"`
Version string `json:"version,omitempty"`
Running bool `json:"running"`
PID int `json:"pid,omitempty"`
}
CloudflaredCheck cloudflared 二进制和进程检测
type DiagnoseResult ¶ added in v0.8.0
type DiagnoseResult struct {
Cloudflared CloudflaredCheck `json:"cloudflared"`
API APICheck `json:"api"`
Routes []RouteDiagnose `json:"routes"`
Total int `json:"total"`
Passed int `json:"passed"`
Failed int `json:"failed"`
}
DiagnoseResult 诊断总结果
func Diagnose ¶ added in v0.8.0
func Diagnose(routes []RouteInput) DiagnoseResult
Diagnose 执行 Cloud 模式链路诊断
type RouteDiagnose ¶ added in v0.8.0
type RouteDiagnose struct {
Name string `json:"name"`
Hostname string `json:"hostname"`
Service string `json:"service"`
LocalOK bool `json:"local_ok"`
LocalErr string `json:"local_err,omitempty"`
DNSOK bool `json:"dns_ok"`
DNSErr string `json:"dns_err,omitempty"`
HTTPOK bool `json:"http_ok"`
HTTPErr string `json:"http_err,omitempty"`
}
RouteDiagnose 单条路由诊断
type RouteInput ¶ added in v0.8.0
RouteInput 诊断输入
Click to show internal directories.
Click to hide internal directories.