mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-12-06 06:10:25 +08:00
增加SysLockerService等;提供多个便捷函数
This commit is contained in:
@@ -2,6 +2,17 @@ package serverconfigs
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
func NewTCPProtocolConfigFromJSON(configJSON []byte) (*TCPProtocolConfig, error) {
|
||||
config := &TCPProtocolConfig{}
|
||||
if len(configJSON) > 0 {
|
||||
err := json.Unmarshal(configJSON, config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return config, nil
|
||||
}
|
||||
|
||||
type TCPProtocolConfig struct {
|
||||
BaseProtocol `yaml:",inline"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user