Documentation ¶
Overview ¶
Package accounts provides an interface, structs, and errors needed for providing User and Group account information.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GIDNotFound ¶
GIDNotFound returns a NotFoundError for a missing group searched by GID.
func GroupNameNotFound ¶
GroupNameNotFound returns a NotFoundError for a missing group searched by name.
func UIDNotFound ¶
UIDNotFound returns a NotFoundError for a missing user searched by UID.
func UsernameNotFound ¶
UsernameNotFound returns a NotFoundError for a missing user searched by name.
Types ¶
type AccountProvider ¶
type AccountProvider interface { // UserByName fetches information about a user by searching for a // username. UserByName(name string) (*User, error) // UserByUID fetches information about a user by searching for a // UID. UserByUID(uid uint32) (*User, error) // Users fetches information about all users known by the // AccountProvider. Users() ([]*User, error) // GroupByName fetches information about a group by searching for a // group name. GroupByName(name string) (*Group, error) // GroupByGID fetches information about a group by searching for a // GID. GroupByGID(gid uint32) (*Group, error) // Groups fetches information about all groups known by the // AccountProvider. Groups() ([]*Group, error) // Names fetches the names of all users and groups known by the // AccountProvider. Names() ([]string, error) // IsName returns whether or not the given name if a valid name of a // user/group. IsName(name string) (bool, error) // AuthorizedKeys returns the authorized SSH keys for the given // username. AuthorizedKeys(username string) ([]string, error) }
An AccountProvider provides information about users and groups.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
A NotFoundError reports that the user or group that was searched for does not exist.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Click to show internal directories.
Click to hide internal directories.