user

package
v0.0.0-...-be6b631 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: GPL-3.0 Imports: 10 Imported by: 13

Documentation

Index

Constants

View Source
const (
	DefaultGetentSearchPath = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
)
View Source
const GetentBased = false

Variables

This section is empty.

Functions

func OverrideGetentSearchPath

func OverrideGetentSearchPath(p string)

OverrideGetentSearchPath allows overriding getent search path. Its only purpose is to be used in tests.

Types

type Group

type Group = osuser.Group

func LookupGroup

func LookupGroup(groupname string) (*Group, error)

Lookup looks up a group by group name

This is a wrapper for (os/user).LookupGroup

type UnknownGroupError

type UnknownGroupError = osuser.UnknownGroupError

type UnknownUserError

type UnknownUserError = osuser.UnknownUserError

type User

type User = osuser.User

func Current

func Current() (*User, error)

Current returns the current user

This is a wrapper for (os/user).Current

func Lookup

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

Lookup looks up a user by username

This is a wrapper for (os/user).Lookup

func LookupId

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

Lookup looks up a user by uid

This is a wrapper for (os/user).LookupId

Jump to

Keyboard shortcuts

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