Get allows you to get a user by its name or username. The provided id must be a string for username lookup or a uint for id lookup. If id is neither, a ErrInvalidDataType will be returned.
(baseScope string, followExternalSymlinks bool, id interface{})
| 48 | // id must be a string for username lookup or a uint for id lookup. If id |
| 49 | // is neither, a ErrInvalidDataType will be returned. |
| 50 | func (s *Storage) Get(baseScope string, followExternalSymlinks bool, id interface{}) (user *User, err error) { |
| 51 | user, err = s.back.GetBy(id) |
| 52 | if err != nil { |
| 53 | return |
| 54 | } |
| 55 | if err := user.Clean(baseScope, followExternalSymlinks); err != nil { |
| 56 | return nil, err |
| 57 | } |
| 58 | return |
| 59 | } |
| 60 | |
| 61 | // GetByScope returns the first user whose scope matches the given one, or |
| 62 | // ErrNotExist if none does. The user is returned as stored, without setting up |