socket

package
v0.4.13 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UnidentifiedProcessID is originally defined in the process pkg, but duplicated here because of import loops.
	UnidentifiedProcessID = -1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	IP   net.IP
	Port uint16
}

Address is an IP + Port pair.

type BindInfo

type BindInfo struct {
	Local Address
	PID   int
	UID   int
	Inode int
}

BindInfo holds socket information returned by the system.

func (*BindInfo) GetInode added in v0.4.12

func (i *BindInfo) GetInode() int

GetInode returns the Inode.

func (*BindInfo) GetPID added in v0.4.12

func (i *BindInfo) GetPID() int

GetPID returns the PID.

func (*BindInfo) GetUID added in v0.4.12

func (i *BindInfo) GetUID() int

GetUID returns the UID.

func (*BindInfo) SetPID added in v0.4.12

func (i *BindInfo) SetPID(pid int)

SetPID sets the PID to the given value.

type ConnectionInfo

type ConnectionInfo struct {
	Local  Address
	Remote Address
	PID    int
	UID    int
	Inode  int
}

ConnectionInfo holds socket information returned by the system.

func (*ConnectionInfo) GetInode added in v0.4.12

func (i *ConnectionInfo) GetInode() int

GetInode returns the Inode.

func (*ConnectionInfo) GetPID added in v0.4.12

func (i *ConnectionInfo) GetPID() int

GetPID returns the PID.

func (*ConnectionInfo) GetUID added in v0.4.12

func (i *ConnectionInfo) GetUID() int

GetUID returns the UID.

func (*ConnectionInfo) SetPID added in v0.4.12

func (i *ConnectionInfo) SetPID(pid int)

SetPID sets the PID to the given value.

type Info added in v0.4.12

type Info interface {
	GetPID() int
	SetPID(int)
	GetUID() int
	GetInode() int
}

Info is a generic interface to both ConnectionInfo and BindInfo.

Jump to

Keyboard shortcuts

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