group

package
v0.0.0-...-01ee8fb Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package group allows group lookups by name or id.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	Gid       string
	Groupname string
}

Group represents a user group.

On posix systems Gid contains a decimal number representing gid.

func Current

func Current() (*Group, error)

Current returns the current group.

func Lookup

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

Lookup looks up a group by groupname. If the group cannot be found, the returned error is of type UnknownGroupError.

func LookupId

func LookupId(gid string) (*Group, error)

LookupId looks up a group by groupid. If the group cannot be found, the returned error is of type UnknownGroupIdError.

type UnknownGroupError

type UnknownGroupError string

UnknownGroupError is returned by Lookup when a group cannot be found.

func (UnknownGroupError) Error

func (e UnknownGroupError) Error() string

type UnknownGroupIdError

type UnknownGroupIdError int

UnknownGroupIdError is returned by LookupId when a group cannot be found.

func (UnknownGroupIdError) Error

func (e UnknownGroupIdError) Error() string

Jump to

Keyboard shortcuts

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