Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Foundation
- // @saber.scope(App)
- // @saber.cached
- class UserStorage {
- /// List all registered users
- var allUsers: [User] {
- return ...
- }
- /// Registers a user and its password.
- /// Throws an exception if user's already exist.
- func register(_ user: User, password: String) throws {
- ...
- }
- /// Checks user password
- func check(id: User.Id, password: String) -> Bool {
- return ...
- }
- /// Finds user by id
- func find(id: User.Id) -> User? {
- return ...
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement