25 lines
		
	
	
		
			593 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			593 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package budgeteer
 | 
						|
 | 
						|
// User struct contains Login information
 | 
						|
type User struct {
 | 
						|
	ID       ID
 | 
						|
	Email    string
 | 
						|
	Password string
 | 
						|
	Name     string
 | 
						|
}
 | 
						|
 | 
						|
// UserService provides Methods for CRUD of Users
 | 
						|
type UserService interface {
 | 
						|
	User(id ID) (*User, error)
 | 
						|
	UserByUsername(username string) (*User, error)
 | 
						|
	//Users() ([]*User, error)
 | 
						|
	CreateUser(u *User) error
 | 
						|
	//DeleteUser(id int) error
 | 
						|
}
 | 
						|
 | 
						|
// CredentialVerifier verifies the provided credentials
 | 
						|
type CredentialVerifier interface {
 | 
						|
	Verify(password string, hashOnDb string) error
 | 
						|
	Hash(password string) (string, error)
 | 
						|
}
 |