getent

package
v0.0.0-...-4450389 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2019 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecError

type ExecError struct {
	What string
	Err  error
}

func (*ExecError) Error

func (err *ExecError) Error() string

type Group

type Group struct {
	Group string
	Gid   uint32
	Users []string
}

func DedupGroups

func DedupGroups(groups []Group) ([]Group, error)

`DedupGroups()` returns a list without duplicate groups. It returns an error if the input contains conflicting duplicates.

func Groups

func Groups(ctx context.Context) ([]Group, error)

`Groups()` returns a list of Unix groups as reported by `getent`. The list may contain duplicates, even conflicting ones.

func SelectGroups

func SelectGroups(
	groups []Group,
	prefixes []string,
) []Group

`SelectGroups()` selects `groups` whose names begin with any of the `prefixes`.

func (Group) IsEqual

func (a Group) IsEqual(b Group) bool

type GroupConflictError

type GroupConflictError struct {
	AGroup string
	AGid   uint32
	BGroup string
	BGid   uint32
}

func (*GroupConflictError) Error

func (err *GroupConflictError) Error() string

type ParseError

type ParseError struct {
	What string
	Text string
}

func (*ParseError) Error

func (err *ParseError) Error() string

type Passwd

type Passwd struct {
	User string
	Uid  uint32
	Gid  uint32
}

func Passwds

func Passwds(ctx context.Context) ([]Passwd, error)

func SelectPasswds

func SelectPasswds(pwds []Passwd, groups []Group) []Passwd

Jump to

Keyboard shortcuts

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