mirror of
https://github.com/mainflux/mainflux.git
synced 2025-04-29 13:49:28 +08:00

Setup top-level glide dependencies file. Migrated all of the manager service code into this repository. Fixed docker build procedure. Extracted executable to the top-level. Signed-off-by: Dejan Mijic <dejan@mainflux.com>
27 lines
595 B
Go
27 lines
595 B
Go
package manager
|
|
|
|
// User represents a Mainflux user account. Each user is identified given its
|
|
// email and password.
|
|
type User struct {
|
|
Email string
|
|
Password string
|
|
}
|
|
|
|
func (u *User) validate() error {
|
|
if u.Email == "" || u.Password == "" {
|
|
return ErrInvalidCredentials
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// UserRepository specifies an account persistence API.
|
|
type UserRepository interface {
|
|
// Save persists the user account. A non-nil error is returned to indicate
|
|
// operation failure.
|
|
Save(User) error
|
|
|
|
// One retrieves user by its unique identifier (i.e. email).
|
|
One(string) (User, error)
|
|
}
|