mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-01 04:54:02 +03:00
Add EventTraffic
This commit is contained in:
+16
-4
@@ -6,12 +6,24 @@ import (
|
||||
)
|
||||
|
||||
type streamInfo struct {
|
||||
createdAt time.Time
|
||||
clientIP net.IP
|
||||
createdAt time.Time
|
||||
clientIP net.IP
|
||||
remoteIP net.IP
|
||||
dc int
|
||||
bytesSentToTelegram uint
|
||||
bytesRecvFromTelegram uint
|
||||
}
|
||||
|
||||
func (s *streamInfo) IPType() string {
|
||||
if s.clientIP.To4() == nil {
|
||||
func (s *streamInfo) GetClientIPType() string {
|
||||
return s.getIPType(s.clientIP)
|
||||
}
|
||||
|
||||
func (s *streamInfo) GetRemoteIPType() string {
|
||||
return s.getIPType(s.remoteIP)
|
||||
}
|
||||
|
||||
func (s *streamInfo) getIPType(ip net.IP) string {
|
||||
if ip.To4() == nil {
|
||||
return TagIPTypeIPv6
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user