Documentation ¶
Index ¶
Constants ¶
View Source
const CacheKeyFormat = "%s_%s_%s" // name, type, subnet
CacheKeyFormat the format of cache store key
View Source
const ProtonLOGO = `` /* 182-byte string literal not displayed */
ProtonLOGO console output when starting
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BasicConfig ¶
BasicConfig with addr and port
type ProtonConfig ¶
type ProtonConfig struct { TCP TCPConfig `toml:"tcp"` // TCP 配置 UDP UDPConfig `toml:"udp"` // UDP 配置 Proxy ProxyConfig `toml:"proxy"` // 代理配置 Cache CacheConfig `toml:"cache"` // 缓存配置 }
ProtonConfig the whole config
func GetProtonConfig ¶
func GetProtonConfig(configPath string) (ProtonConfig, error)
GetProtonConfig 解析 toml 配置
type ProtonStat ¶
type ProtonStat struct { StartAt time.Time // 服务启动时间 ResolveCount uint64 // 解析数 HitCount uint64 // hit 数 }
ProtonStat a struct for cache statistics data
func NewProtonStat ¶
func NewProtonStat() *ProtonStat
NewProtonStat return ProtonStat with default value
func (*ProtonStat) Resolve ¶
func (s *ProtonStat) Resolve() *ProtonStat
Resolve will +1 when get resolve request
type ProxyConfig ¶
type ProxyConfig struct {
BasicConfig
}
ProxyConfig a important config to make sure the connection between service and Google DNS
Click to show internal directories.
Click to hide internal directories.