diff options
Diffstat (limited to 'sd_login/logind_user.go')
-rw-r--r-- | sd_login/logind_user.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sd_login/logind_user.go b/sd_login/logind_user.go index 81a5418..8d20d4b 100644 --- a/sd_login/logind_user.go +++ b/sd_login/logind_user.go @@ -18,7 +18,7 @@ import ( "strconv" ) -type User int +type UserID int type UserState int @@ -32,26 +32,26 @@ const ( // GetUsers returns a list of all users who currently have login // sessions. -func GetUsers() ([]User, error) { +func GetUsers() ([]UserID, error) { strs, err := get_files_in_directory("/run/systemd/users/") if err != nil { return nil, err } - var users []User + var users []UserID for _, uid_str := range strs { uid, err := strconv.Atoi(uid_str) if err != nil { continue } - users = append(users, User(uid)) + users = append(users, UserID(uid)) } return users, nil } -func (uid User) IsOnSeat(seat Seat, requireActive bool) bool -func (uid User) GetState() (UserState, error) +func (uid UserID) IsOnSeat(seat SeatName, requireActive bool) bool +func (uid UserID) GetState() (UserState, error) // primary session -func (uid User) GetDisplay() (Session, error) -func (uid User) GetSessions(requireActive bool) ([]Session, error) -func (uid User) GetSeats(requireActive bool) ([]Seat, error) +func (uid UserID) GetDisplay() (SessionName, error) +func (uid UserID) GetSessions(requireActive bool) ([]SessionName, error) +func (uid UserID) GetSeats(requireActive bool) ([]SeatName, error) |