1
0
mirror of https://github.com/mainflux/mainflux.git synced 2025-04-29 13:49:28 +08:00
Dejan Mijic c966a7802d
Integrate manager service
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>
2017-09-23 01:03:27 +02:00

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)
}