Server defines a contract for tcp servers. This is a little bit of smell because this is some sort of APIs that going to be exposed to user and already that is a lot of behaviors brought in a generic interface.
| 24 | // This is a little bit of smell because this is some sort of APIs that going to be exposed to user |
| 25 | // and already that is a lot of behaviors brought in a generic interface. |
| 26 | type Server interface { |
| 27 | Start() error |
| 28 | Stop() error |
| 29 | Wait() error |
| 30 | } |
| 31 | |
| 32 | // server is our Server implementation. |
| 33 | // They match the name. However, that is not necessarily bad. |