(cfg *Configuration)
| 50 | } |
| 51 | |
| 52 | func NewServer(cfg *Configuration) (server Server, err error) { |
| 53 | serverImpl := &serverImpl{ |
| 54 | configuration: cfg, |
| 55 | shellInfoMap: make(map[int]*shellInfo), |
| 56 | } |
| 57 | go serverImpl.waitAttach() |
| 58 | go serverImpl.trimLogs() |
| 59 | |
| 60 | err = serverImpl.listen() |
| 61 | if err != nil { |
| 62 | return |
| 63 | } |
| 64 | server = serverImpl |
| 65 | return |
| 66 | } |
| 67 | |
| 68 | type shellInfo struct { |
| 69 | pid int |
no test coverage detected