Documentation ¶
Index ¶
- Constants
- Variables
- type Database
- func (db Database) AddItem(item *models.Item) error
- func (db Database) DeleteItem(itemId int) error
- func (db Database) DeleteUser(userId int) error
- func (db Database) GetAllItems() (*models.ItemList, error)
- func (db Database) GetAllUsers() (*models.UserList, error)
- func (db Database) GetItemById(itemId int) (models.Item, error)
- func (db Database) GetUserById(userId int) (models.User, error)
- func (db Database) GetUserByIdUsernameAndPassword(user *models.User) (*models.User, error)
- func (db Database) GetUserByUsername(user *models.User) (*models.User, error)
- func (db Database) NewUser(user *models.User) error
- func (db Database) UpdateItem(itemId int, itemData models.Item) (models.Item, error)
Constants ¶
View Source
const (
// HOST = "database"
PORT = 5432
)
Variables ¶
View Source
var ErrNoMatch = fmt.Errorf("no matching record")
ErrNoMatch is returned when we request a row that doesn't exist
Functions ¶
This section is empty.
Types ¶
type Database ¶
func Initialize ¶
Connect to the Database
func (Database) DeleteItem ¶
func (Database) DeleteUser ¶
func (Database) GetUserByIdUsernameAndPassword ¶
func (Database) GetUserByUsername ¶
Click to show internal directories.
Click to hide internal directories.