package cybersecurity // PortResult is a sum type for TCP port scan results. type PortResult interface{ portResult() } // PortOpen indicates the port accepted a connection. type PortOpen struct { Port int Banner string } // PortClosed indicates the port refused the connection. type PortClosed struct { Port int } // PortFiltered indicates the port did not respond (timeout). type PortFiltered struct { Port int } func (PortOpen) portResult() {} func (PortClosed) portResult() {} func (PortFiltered) portResult() {}