You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
457 B
19 lines
457 B
package models
|
|
|
|
// The User model represents a registered user.
|
|
type User struct {
|
|
ID int
|
|
Name string
|
|
PassHash []byte
|
|
}
|
|
|
|
// UserRepository is an interface for all database operations
|
|
// the user model makes.
|
|
type UserRepository interface {
|
|
FindUserByID(id int) (User, error)
|
|
FindUserByName(name string) (User, error)
|
|
ListUsers() ([]User, error)
|
|
InsertUser(user User) (int, error)
|
|
UpdateUser(user User) error
|
|
RemoveUser(user User) error
|
|
}
|