user

package
v1.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRange = fmt.Errorf("Uids and gids must be in range %d-%d", minId, maxId)
)

Functions

func GetUserGroupSupplementaryHome

func GetUserGroupSupplementaryHome(userSpec string, defaultUid, defaultGid int, defaultHome string) (int, int, []int, string, error)

Given a string like "user", "1000", "user:group", "1000:1000", returns the uid, gid, list of supplementary group IDs, and home directory, if available and/or applicable.

Types

type Group

type Group struct {
	Name string
	Pass string
	Gid  int
	List []string
}

func ParseGroup

func ParseGroup() ([]*Group, error)

func ParseGroupFilter

func ParseGroupFilter(filter func(*Group) bool) ([]*Group, error)

type User

type User struct {
	Name  string
	Pass  string
	Uid   int
	Gid   int
	Gecos string
	Home  string
	Shell string
}

func ParsePasswd

func ParsePasswd() ([]*User, error)

func ParsePasswdFilter

func ParsePasswdFilter(filter func(*User) bool) ([]*User, error)

Jump to

Keyboard shortcuts

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