mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-12-31 23:56:36 +08:00
阶段性提交
This commit is contained in:
@@ -2,6 +2,17 @@ package serverconfigs
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
func NewHTTPProtocolConfigFromJSON(configJSON []byte) (*HTTPProtocolConfig, error) {
|
||||
config := &HTTPProtocolConfig{}
|
||||
if len(configJSON) > 0 {
|
||||
err := json.Unmarshal(configJSON, config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return config, nil
|
||||
}
|
||||
|
||||
type HTTPProtocolConfig struct {
|
||||
BaseProtocol `yaml:",inline"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user