Documentation ¶
Index ¶
- type Group
- func (g *Group) AddAllToGroup(group, passwdpath string) error
- func (g *Group) AddEntry(e *GroupEntry)
- func (g *Group) AddUser(group, user string) error
- func (g *Group) Close()
- func (g *Group) GetEntry(name string) (*GroupEntry, error)
- func (g *Group) Merge(other *Group) error
- func (g *Group) String() string
- func (g *Group) Write() error
- type GroupEntry
- type Passwd
- type PasswdEntry
- type SharedFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group struct { File *SharedFile Entries map[string]*GroupEntry }
Group describes an /etc/group style file.
func (*Group) AddAllToGroup ¶
AddAllToGroup adds all accounts in the passwd given to the group given in the etc/group file specified.
func (*Group) AddEntry ¶
func (g *Group) AddEntry(e *GroupEntry)
AddEntry will add or overwrite an existing entry to the Group
func (*Group) GetEntry ¶
func (g *Group) GetEntry(name string) (*GroupEntry, error)
GetEntry retrives a group entry by name.
type GroupEntry ¶
GroupEntry describes an entry in a group file.
func (*GroupEntry) Merge ¶
func (ge *GroupEntry) Merge(b *GroupEntry) error
Merge two group entries. The passed in entry takes precedence if there is a clash. Names must match though.
func (*GroupEntry) Write ¶
func (e *GroupEntry) Write() string
type Passwd ¶
type Passwd struct { File *SharedFile Entries map[string]PasswdEntry }
func OpenPasswd ¶
func (*Passwd) Add ¶
func (p *Passwd) Add(e *PasswdEntry) error
Add a passwd entry to the passwd file.
func (*Passwd) Contains ¶
func (p *Passwd) Contains(pe *PasswdEntry) bool
Contains returns true if the passed entry is in the Passwd file.
type PasswdEntry ¶
func (*PasswdEntry) Equals ¶
func (pe *PasswdEntry) Equals(other *PasswdEntry) bool
func (*PasswdEntry) Write ¶
func (e *PasswdEntry) Write() string
type SharedFile ¶
type SharedFile struct { // contains filtered or unexported fields }
func SharedOpen ¶
func SharedOpen(path string) (*SharedFile, error)
func (*SharedFile) Close ¶
func (sf *SharedFile) Close()
Click to show internal directories.
Click to hide internal directories.