PROTOCOL
# UserStorage
A type representing storage, where already the users will be kept between app launches. By default this SDK uses concrete implementation of the protocol done at SQLiteUserStorage class. Also keep in mind, that this protocol doesn’t provide any data encryption and therefore developers have to implement it by themselves.
# Methods
# loadStorage()
Loads storage and its data into the memory.
# add(user:)
Adds a new user to the storage.
- Parameter user: a user that needs to be added to the storage.
# delete(user:)
Deletes the user from the storage.
- Parameter user: a user that needs to be deleted to the storage.
# update(user:)
Updates the user in the storage
- Parameter user: a user that needs to be updated to the storage.
# all()
Get all users written in the storage.
# getUser(by:projectId:)
Get User object by its user id and project id. If User isn’t present in the storage this method returns nil.
- Parameters:
- userId: a user id to be checked in the storage.
- projectId: a project id to be checked in the storage.
# getIdentity(by:)
Getting identity by its identifier.
- Parameter id: identifier of the identity.
# add(identity:)
Adding new identity to the storage.
- Parameter identity: identity object that will be written in the storage.
# update(identity:)
Updates the identity object written in the storage.
- Parameter identity: identity object written in the storage.