userx

package
v0.0.0-...-dc5530c Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2016 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Drop in replacement for the os/user package. Useful when building without cgo.

Index

Constants

View Source
const UserDatabase = "/etc/passwd"

Variables

View Source
var InvalidUserDatabaseError = errors.New("invalid user database")

Functions

func Current

func Current() (*user.User, error)

Current returns the current user.

func IAmPrivileged

func IAmPrivileged() bool

func Lookup

func Lookup(username string) (*user.User, error)

Lookup looks up a user by username. If the user cannot be found, the returned error is of type UnknownUserError.

func LookupId

func LookupId(uid string) (*user.User, error)

LookupId looks up a user by userid. If the user cannot be found, the returned error is of type UnknownUserIdError.

Types

type PasswdRecord

type PasswdRecord struct {
	Name      string
	Password  string
	Uid       string
	Gid       string
	Gecos     string
	Directory string
	Shell     string
}

Jump to

Keyboard shortcuts

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