Documentation ¶
Index ¶
- Constants
- func AddGroupForUser(group, user string) error
- func CanNoPasswdLogin(username string) bool
- func CreateGuestUser() (string, error)
- func CreateUser(username, fullname, shell string) error
- func DeleteGroupForUser(group, user string) error
- func DeleteUser(rmFiles bool, username string) error
- func EnableNoPasswdLogin(username string, enabled bool) error
- func EncodePasswd(words string) string
- func GetAllGroups() ([]string, error)
- func GetAutoLoginUser() (string, error)
- func GetDMConfig() (string, error)
- func GetDefaultXSession() (string, error)
- func GetPresetGroups(userType int) []string
- func GetUserGroups(user string) ([]string, error)
- func IsAdminUser(username string) bool
- func IsAutoLoginUser(username string) bool
- func IsPasswordExpired(username string) (bool, error)
- func LockedUser(locked bool, username string) error
- func ModifyFullName(fullName, username string) error
- func ModifyHome(dir, username string) error
- func ModifyMaxPasswordAge(username string, nDays int) error
- func ModifyPasswd(words, username string) error
- func ModifyShell(shell, username string) error
- func SetAutoLoginUser(username, session string) error
- func SetGroupsForUser(groups []string, user string) error
- type Cache
- type CacheProviderFn
- type CommentInfo
- type GroupInfo
- type ShadowInfo
- type UserInfo
- type UserInfos
Constants ¶
View Source
const ( UserTypeStandard = iota UserTypeAdmin )
View Source
const ( // Same as the abbreviation in `passwd --status` PasswordStatusUsable = "P" PasswordStatusNoPassword = "NP" PasswordStatusLocked = "L" )
View Source
const CommentFieldsLen = 5
Variables ¶
This section is empty.
Functions ¶
func AddGroupForUser ¶
func CanNoPasswdLogin ¶
func CreateGuestUser ¶
func CreateUser ¶
func DeleteGroupForUser ¶
func DeleteUser ¶
func EnableNoPasswdLogin ¶
func EncodePasswd ¶
func GetAllGroups ¶
func GetAutoLoginUser ¶
GetAutoLoginUser get the autologin user, if no, return empty string
func GetDMConfig ¶
GetDMConfig return the current display manager
func GetDefaultXSession ¶
GetDefaultXSession return the default user session
func GetPresetGroups ¶
func GetUserGroups ¶
func IsAdminUser ¶
func IsAutoLoginUser ¶
func IsPasswordExpired ¶
func LockedUser ¶
func ModifyFullName ¶
func ModifyHome ¶
func ModifyMaxPasswordAge ¶
func ModifyPasswd ¶
func ModifyShell ¶
func SetAutoLoginUser ¶
SetAutoLoginUser set the autologin user, if disable autologin, set the 'username' to empty string
func SetGroupsForUser ¶
Types ¶
type CacheProviderFn ¶
type CommentInfo ¶
type CommentInfo [CommentFieldsLen]string
CommentInfo is passwd file user comment info
func (*CommentInfo) FullName ¶
func (ci *CommentInfo) FullName() string
func (*CommentInfo) SetFullName ¶
func (ci *CommentInfo) SetFullName(value string)
func (*CommentInfo) String ¶
func (ci *CommentInfo) String() string
type ShadowInfo ¶
func GetShadowInfo ¶
func GetShadowInfo(username string) (*ShadowInfo, error)
type UserInfo ¶
type UserInfo struct { Name string Uid string Gid string Home string Shell string // contains filtered or unexported fields }
func GetUserInfoByName ¶
func GetUserInfoByUid ¶
func (*UserInfo) Comment ¶
func (u *UserInfo) Comment() *CommentInfo
type UserInfos ¶
type UserInfos []UserInfo
func GetAllUserInfos ¶
func GetHumanUserInfos ¶
func (UserInfos) GetUserNames ¶
Click to show internal directories.
Click to hide internal directories.