pwd

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package pwd provides some functions to query the passwd database of a UNIX system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Passwd

type Passwd struct {
	Name   string
	Passwd string
	Uid    int
	Gid    int
	Gecos  string
	Dir    string
	Shell  string
}

Passwd represents a record in the passwd database.

func Getpwall

func Getpwall() ([]*Passwd, error)

Getpwall returns all the records in the passwd database.

func Getpwnam

func Getpwnam(name string) (*Passwd, error)

Getpwnam looks up the passwd database and returns the record matching the given user name. If no record is found, it returns (nil, nil). It is the equivalent of the C function getpwnam.

func Getpwuid

func Getpwuid(uid int) (*Passwd, error)

Getpwuid looks up the passwd database and returns the record matching the given UID. If no record is found, it returns (nil, nil). It is the equivalent of the C function getpwuid.

Jump to

Keyboard shortcuts

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