user

package
v0.0.0-...-f8c0f81 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2011 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package user allows user account lookups by name or id.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UnknownUserError

type UnknownUserError string

UnknownUserError is returned by Lookup when a user cannot be found.

func (UnknownUserError) String

func (e UnknownUserError) String() string

type UnknownUserIdError

type UnknownUserIdError int

UnknownUserIdError is returned by LookupId when a user cannot be found.

func (UnknownUserIdError) String

func (e UnknownUserIdError) String() string

type User

type User struct {
	Uid      int // user id
	Gid      int // primary group id
	Username string
	Name     string
	HomeDir  string
}

User represents a user account.

func Lookup

func Lookup(username string) (*User, os.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 int) (*User, os.Error)

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

Jump to

Keyboard shortcuts

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