( commonCfg configuration.Common, cfg configuration.Server, cmds command.Commands, )
| 92 | } |
| 93 | |
| 94 | func newSocketCtl( |
| 95 | commonCfg configuration.Common, |
| 96 | cfg configuration.Server, |
| 97 | cmds command.Commands, |
| 98 | ) socket { |
| 99 | randomKey := getNewSocketCtlRandomSharedKey() |
| 100 | |
| 101 | return socket{ |
| 102 | commonCfg: commonCfg, |
| 103 | serverCfg: cfg, |
| 104 | randomKey: randomKey, |
| 105 | authKey: getSocketAuthKey(randomKey, commonCfg.SharedKey)[:32], |
| 106 | upgrader: buildWebsocketUpgrader(cfg), |
| 107 | commander: command.New(cmds), |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | type websocketWriter struct { |
| 112 | *websocket.Conn |
no test coverage detected