2024-10-12 20:41:30 +03:00
|
|
|
package storage
|
|
|
|
|
2024-10-13 17:18:53 +03:00
|
|
|
// Storage is an interface for arbitrary storage
|
2024-10-12 20:41:30 +03:00
|
|
|
type Storage interface {
|
2024-10-13 17:18:53 +03:00
|
|
|
Add(email, password string) error // Add inserts a user into data
|
|
|
|
ById(uuid string) (User, bool) // ById retrieves a user by their UUID
|
|
|
|
ByEmail(email string) (User, bool) // ByEmail retrieves a user by their email
|
|
|
|
Taken(email string) bool // Taken checks whether an email is taken
|
2024-10-12 20:41:30 +03:00
|
|
|
}
|
2024-10-13 16:16:19 +03:00
|
|
|
|
2024-10-13 17:18:53 +03:00
|
|
|
// Data stores active information for the app.
|
|
|
|
// It should be populated on startup
|
2024-10-13 16:16:19 +03:00
|
|
|
var Data Storage
|