osuser
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package osuser implements OS user lookup. It's a wrapper around os/user thatworks on non-cgo builds.
Index¶
- func GetGroupIds(user *user.User) ([]string, error)
- func LookupByUID(uid string) (*user.User, error)
- func LookupByUIDWithShell(uid string) (u *user.User, shell string, err error)
- func LookupByUsername(username string) (*user.User, error)
- func LookupByUsernameWithShell(username string) (u *user.User, shell string, err error)
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcGetGroupIds¶added inv1.66.0
GetGroupIds returns the list of group IDs that the user is a member of, oran error. It will first try to use the 'id' command to get the group IDs,and if that fails, it will fall back to the user.GroupIds method.
funcLookupByUID¶
LookupByUID is like os/user.LookupId but handles a few edge cases likegokrazy and non-cgo lookups.
funcLookupByUIDWithShell¶
LookupByUIDWithShell is like os/user.LookupId but handles a few edge caseslike gokrazy and non-cgo lookups, and returns the user shell. The user shelllookup is best-effort and may be empty.
funcLookupByUsername¶
LookupByUsername is like os/user.Lookup but handles a few edge cases likegokrazy and non-cgo lookups.
funcLookupByUsernameWithShell¶
LookupByUsernameWithShell is like os/user.Lookup but handles a few edgecases like gokrazy and non-cgo lookups, and returns the user shell. The usershell lookup is best-effort and may be empty.
Types¶
This section is empty.