mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-12-25 11:36:35 +08:00
增加SysLockerService等;提供多个便捷函数
This commit is contained in:
@@ -1,6 +1,20 @@
|
||||
package serverconfigs
|
||||
|
||||
import "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/sslconfigs"
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/sslconfigs"
|
||||
)
|
||||
|
||||
func NewTLSProtocolConfigFromJSON(configJSON []byte) (*TLSProtocolConfig, error) {
|
||||
config := &TLSProtocolConfig{}
|
||||
if len(configJSON) > 0 {
|
||||
err := json.Unmarshal(configJSON, config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return config, nil
|
||||
}
|
||||
|
||||
// TLS协议配置
|
||||
type TLSProtocolConfig struct {
|
||||
@@ -26,3 +40,8 @@ func (this *TLSProtocolConfig) Init() error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// 转换为JSON
|
||||
func (this *TLSProtocolConfig) AsJSON() ([]byte, error) {
|
||||
return json.Marshal(this)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user