system

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AF_INET                 = 2
	TCP_TABLE_OWNER_PID_ALL = 5
	UDP_TABLE_OWNER_PID     = 1
	MIB_TCP_STATE_LISTEN    = 2
)

Variables

This section is empty.

Functions

func GetCountryByIP

func GetCountryByIP(ipStr string) (string, error)

Types

type ConnectionInfo

type ConnectionInfo struct {
	Protocol    string // "TCP" or "UDP"
	LocalAddr   string // Local side IP address
	LocalPort   uint16 // Local side port
	RemoteAddr  string // Remote side IP address (for TCP)
	RemotePort  uint16 // Remote side port (for TCP)
	State       string // Connection state (for TCP)
	PID         uint32 // Process ID
	ProcessName string // Process name
}

ConnectionInfo contains detailed information about a single network connection

type Event

type Event struct {
	Name      string
	Parameter string
}

type GeoIP

type GeoIP struct {
	// contains filtered or unexported fields
}

func OpenGeoIP

func OpenGeoIP() (*GeoIP, error)

func (*GeoIP) Close

func (g *GeoIP) Close() error

type MIB_TCPROW_OWNER_PID

type MIB_TCPROW_OWNER_PID struct {
	State      uint32
	LocalAddr  uint32
	LocalPort  uint32
	RemoteAddr uint32
	RemotePort uint32
	OwningPid  uint32
}

type MIB_TCPTABLE_OWNER_PID

type MIB_TCPTABLE_OWNER_PID struct {
	NumEntries uint32
	Table      [1]MIB_TCPROW_OWNER_PID
}

type MIB_UDPROW_OWNER_PID

type MIB_UDPROW_OWNER_PID struct {
	LocalAddr uint32
	LocalPort uint32
	OwningPid uint32
}

type MIB_UDPTABLE_OWNER_PID

type MIB_UDPTABLE_OWNER_PID struct {
	NumEntries uint32
	Table      [1]MIB_UDPROW_OWNER_PID
}

type NetworkConnections

type NetworkConnections struct {
	Connections []ConnectionInfo
}

NetworkConnections contains all network connections

func GetAllConnections

func GetAllConnections() NetworkConnections

GetAllConnections returns information about all network connections (TCP and UDP)

type PortMap

type PortMap map[uint16][]ProcInfo

type ProcInfo

type ProcInfo struct {
	PID  uint32
	Name string
}

type System

type System struct {
	// contains filtered or unexported fields
}
var Instance *System

func NewSystem

func NewSystem() *System

func (*System) EmitEvent

func (c *System) EmitEvent(event string, parameter string)

func (*System) GetAndClearEvents

func (c *System) GetAndClearEvents() []Event

func (*System) GetFilterStatus

func (c *System) GetFilterStatus() string

func (*System) GetFilterType

func (c *System) GetFilterType() string

func (*System) GetProcessName

func (c *System) GetProcessName(pid uint32) string

func (*System) GetServiceByPort

func (c *System) GetServiceByPort(port uint16) string

func (*System) IsLocalAreaNetwork

func (c *System) IsLocalAreaNetwork(ip string) bool

func (*System) SetFilterStatus

func (c *System) SetFilterStatus(filterStatus string)

func (*System) SetFilterType

func (c *System) SetFilterType(filterType string)

func (*System) Start

func (c *System) Start()

func (*System) Stop

func (c *System) Stop()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL