mirror of
https://gogs.blitter.com/RLabs/goutmp
synced 2024-08-14 19:26:41 +00:00
Update 'README.md'
This commit is contained in:
parent
e75ee8b119
commit
73aea4ba72
1 changed files with 21 additions and 3 deletions
24
README.md
24
README.md
|
@ -3,15 +3,33 @@ goutmp - Minimal bindings to C stdlib pututmpx(), getutmpx() (/var/log/wtmp) and
|
|||
Any Go program which allows user shell access should update the standard UNIX files which track user sessions: /var/log/wtmp (for the 'w' and 'who' commands), and /var/log/lastlog (the 'last' and 'lastlog' commands).
|
||||
|
||||
```
|
||||
go doc
|
||||
$ go doc -all
|
||||
package goutmp // import "blitter.com/go/goutmp"
|
||||
|
||||
Golang bindings for basic login/utmp accounting
|
||||
|
||||
type UtmpEntry struct{ ... }
|
||||
FUNCTIONS
|
||||
|
||||
func GetHost(addr string) (h string)
|
||||
return remote client hostname or IP if host lookup fails addr is expected to
|
||||
be of the format given by net.Addr.String() eg., "127.0.0.1:80" or
|
||||
"[::1]:80"
|
||||
|
||||
func Put_lastlog_entry(app, usr, ptsname, host string)
|
||||
Put the login app, username and originating host/IP to lastlog
|
||||
|
||||
func Unput_utmp(entry UtmpEntry)
|
||||
func Put_utmp(user, ptsname, host string) UtmpEntry
|
||||
Remove a username/host entry from utmp
|
||||
|
||||
|
||||
TYPES
|
||||
|
||||
type UtmpEntry struct {
|
||||
// Has unexported fields.
|
||||
}
|
||||
UtmpEntry wraps the C struct utmp
|
||||
|
||||
func Put_utmp(user, ptsName, host string) UtmpEntry
|
||||
Put a username and the originating host/IP to utmp
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in a new issue