增加SysLockerService等;提供多个便捷函数

This commit is contained in:
GoEdgeLab
2021-01-14 16:34:16 +08:00
parent 3bf931d8dc
commit facd88e8fd
11 changed files with 1580 additions and 541 deletions

View File

@@ -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"`
}