Documentation ¶
Index ¶
Constants ¶
View Source
const ( Empty Utype = iota // Record does not contain valid info (formerly known as UT_UNKNOWN on Linux) RunLevel = iota // Change in system run-level (see init(8)) BootTime = iota // Time of system boot (in ut_tv) NewTime = iota // Time after system clock change (in ut_tv) OldTime = iota // Time before system clock change (in ut_tv) InitProcess = iota // Process spawned by init(8) LoginProcess = iota // Session leader process for user login UserProcess = iota // Normal process DeadProcess = iota // Terminated process Accounting = iota // Not implemented LineSize = 32 NameSize = 32 HostSize = 256 )
Type for ut_exit, below
Variables ¶
This section is empty.
Functions ¶
func AddrToString ¶
AddrToString only handles IPv4 strings right now
Types ¶
type TimeVal ¶
func (TimeVal) MarshalJSON ¶
Correctly marshal unix times to human readable timestamps
type Utmp ¶
type Utmp struct { Type Utype `json:"type"` // Type of record Pid int32 `json:"pid"` // PID of login process Device [LineSize]byte `json:"device"` // Device name of tty - "/dev/" Id [4]byte `json:"id"` // Terminal name suffix or inittab(5) ID User [NameSize]byte `json:"user"` // Username Host [HostSize]byte `json:"host"` // Hostname for remote login or kernel version for run-level messages Exit exit_status `json:"exit"` // Exit status of a process marked as DeadProcess; not used by Linux init(1) Session int32 `json:"session"` // Session ID (getsid(2)), used for windowing Time TimeVal `json:"time"` // Time entry was made Addr [4]int32 `json:"address"` // Internet address of remote host; IPv4 address uses just Addr[0] Unused [20]byte `json:"-"` // Reserved for future use // contains filtered or unexported fields }
func (Utmp) MarshalJSON ¶
Overrides the default Marshal method for Utmp
MarshalJSON correctly interprets the address field and byte arrays into properly formatted strings stripped of empty padding
Click to show internal directories.
Click to hide internal directories.