user

package
v0.0.35-0...-fad7822 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGroup

func NewGroup(r io.Reader) (*groupFile, error)

NewGroup creates a group file reader.

func NewGroupFromFile

func NewGroupFromFile(path string) (*groupFile, error)

NewGroupFromFile creates a group file reader from provided path

func NewPasswd

func NewPasswd(r io.Reader) (*passwdFile, error)

NewPasswd creates a passwd file reader.

func NewPasswdFromFile

func NewPasswdFromFile(path string) (*passwdFile, error)

NewPasswdFromFile creates a passwd file reader from provided path

Types

type Group

type Group user.Group

Group defines a group data type

func (Group) String

func (g Group) String() string

String returns the group info in /etc/group format

type GroupFile

type GroupFile interface {
	io.WriterTo
	// Upsert creates or updates the group in the group database
	Upsert(g osuser.Group)
}

GroupFile defines an interface to a group file.

type PasswdFile

type PasswdFile interface {
	io.WriterTo
	// Upsert creates or updates the user in the passwd database
	Upsert(u osuser.User)
}

PasswdFile defines an interface to a passwd file.

type User

type User user.User

User defines a user data type

func LookupID

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

LookupID returns user for the specified uid

func (User) Group

func (u User) Group() (*Group, error)

Group returns group this user belongs to

func (User) String

func (u User) String() string

String returns the user info in /etc/passwd format

Jump to

Keyboard shortcuts

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