unix

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const EtcPasswd = "/etc/passwd"

Variables

This section is empty.

Functions

func FindHomeByNameInPasswd

func FindHomeByNameInPasswd(file, name string) (string, error)

FindHomeByNameInPasswd finds the home directory of a user by the user's name in an /etc/passwd file.

func FindHomeByUIDInPasswd

func FindHomeByUIDInPasswd(file string, uid int64) (string, error)

FindHomeByUIDInPasswd finds the home directory of a user by the user's uid in an /etc/passwd file.

func FindUIDByNameInPasswd

func FindUIDByNameInPasswd(file, user string) (*int64, error)

FindUIDByNameInPasswd finds the UID of a user by name in an /etc/passwd file. It can also find the GID of a group by name in an /etc/group file.

func FindUIDByNameInPasswdReader

func FindUIDByNameInPasswdReader(reader io.Reader, user string) (*int64, error)

FindUIDByNameInPasswdReader finds the UID of a user by name in a stream encoded like the contents of /etc/passwd. It can also find the GID of a group by name in a stream encoded like the contents of /etc/group.

Types

This section is empty.

Jump to

Keyboard shortcuts

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