Advertisement
Guest User

Untitled

a guest
Apr 28th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. import Foundation
  2.  
  3. // @saber.scope(App)
  4. // @saber.cached
  5. class UserStorage {
  6.  
  7. /// List all registered users
  8. var allUsers: [User] {
  9. return ...
  10. }
  11.  
  12. /// Registers a user and its password.
  13. /// Throws an exception if user's already exist.
  14. func register(_ user: User, password: String) throws {
  15. ...
  16. }
  17.  
  18. /// Checks user password
  19. func check(id: User.Id, password: String) -> Bool {
  20. return ...
  21. }
  22.  
  23. /// Finds user by id
  24. func find(id: User.Id) -> User? {
  25. return ...
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement