Chore: move find process name to a single part

This commit is contained in:
Dreamacro
2020-12-17 22:17:27 +08:00
parent 0d33dc3eb9
commit 4b1b494164
10 changed files with 171 additions and 341 deletions

View File

@ -0,0 +1,21 @@
package process
import (
"errors"
"net"
)
var (
ErrInvalidNetwork = errors.New("invalid network")
ErrPlatformNotSupport = errors.New("not support on this platform")
ErrNotFound = errors.New("process not found")
)
const (
TCP = "tcp"
UDP = "udp"
)
func FindProcessName(network string, srcIP net.IP, srcPort int) (string, error) {
return findProcessName(network, srcIP, srcPort)
}