pwd

package module
v0.0.0-...-648ce8f Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2019 License: BSD-2-Clause Imports: 3 Imported by: 0

README

go-pwd

DEPRECATED: You should use os/user package in the standard library

Description

Package pwd is a thin wrapper of C library pwd.h. This is designed as thin as possible, but aimed to be thread-safe.

API

See GoDoc.

License

The Simplified BSD License (2-clause). See LICENSE file also.

Author

Daisuke (yet another) Maki

Documentation

Overview

Package pwd is a thin wrapper of C library <pwd.h>. This is designed as thin as possible, but aimed to be thread-safe.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Passwd

type Passwd struct {
	Name   string // user name
	Passwd string // user password
	UID    uint32 // user ID
	GID    uint32 // group ID
	Gecos  string // real name
	Dir    string // home directory
	Shell  string // shell program
}

Passwd represents an entry of the user database defined in <pwd.h>

func Getpwents

func Getpwents() []*Passwd

Getpwents returns all entries in the user databases. This is aimed to be thread-safe, that is, if a goroutine is executing this function, another goroutine is blocked until it completes.

func Getpwnam

func Getpwnam(name string) *Passwd

Getpwnam searches the user database for an entry with a matching name.

func Getpwuid

func Getpwuid(uid uint32) *Passwd

Getpwuid searches the user database for an entry with a matching uid.

Jump to

Keyboard shortcuts

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