对服务增加基础的数据统计/部分代码分Package

This commit is contained in:
GoEdgeLab
2021-01-25 16:41:30 +08:00
parent 1e85ba4679
commit 1e6297a169
245 changed files with 13026 additions and 8836 deletions
+4 -4
View File
@@ -161,19 +161,19 @@ func (this *ServerConfig) AsJSON() ([]byte, error) {
return json.Marshal(this)
}
func (this *ServerConfig) IsHTTP() bool {
func (this *ServerConfig) IsHTTPFamily() bool {
return this.HTTP != nil || this.HTTPS != nil
}
func (this *ServerConfig) IsTCP() bool {
func (this *ServerConfig) IsTCPFamily() bool {
return this.TCP != nil || this.TLS != nil
}
func (this *ServerConfig) IsUnix() bool {
func (this *ServerConfig) IsUnixFamily() bool {
return this.Unix != nil
}
func (this *ServerConfig) IsUDP() bool {
func (this *ServerConfig) IsUDPFamily() bool {
return this.UDP != nil
}
+4
View File
@@ -95,3 +95,7 @@ func AllServerProtocolsForType(serverType ServerType) []maps.Map {
}
return result
}
func IsHTTPServerType(serverType ServerType) bool {
return serverType == ServerTypeHTTPProxy || serverType == ServerTypeHTTPWeb
}