27 Star 109 Fork 25

MJ PC Lab/go-http-file-server

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
param.go 688 Bytes
一键复制 编辑 原始数据 按行查看 历史
小小猫猫 提交于 2021-12-04 00:17 . feat: upgrade goVirtualHost v1.3.0
package goVirtualHost
import (
"errors"
"fmt"
)
var CertificateNotFound = errors.New("certificate not found for TLS listens")
func (param *param) hasHostNames(checkHostNames []string) bool {
if len(param.hostNames) == 0 || len(checkHostNames) == 0 {
return false
}
for _, ownHostName := range param.hostNames {
for _, checkHostName := range checkHostNames {
if ownHostName == checkHostName {
return true
}
}
}
return false
}
func (param *param) validate() (errs []error) {
if param.useTLS && param.cert == nil {
err := wrapError(CertificateNotFound, fmt.Sprintf("certificate not found for TLS listens: %+v", param))
errs = append(errs, err)
}
return
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/mjpclab/go-http-file-server.git
git@gitee.com:mjpclab/go-http-file-server.git
mjpclab
go-http-file-server
go-http-file-server
v1.13.3-go1.9to1.15

搜索帮助