repository

package
v0.0.0-...-035dfa4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package repository provides methods to interact with the database

Index

Constants

This section is empty.

Variables

View Source
var ErrorBadID error = errors.New("bad id")

ErrorBadID custom error

Functions

This section is empty.

Types

type UsersRepository

type UsersRepository interface {
	Save(user *models.User) error
	GetById(id uint) (*models.User, error)
	GetByEmail(email string) (*models.User, error)
	GetAll() ([]*models.User, error)
	Update(user *models.User) error
	Delete(id uint) error
}

UsersRepository interface defines methods for interacting with the database

func NewUsersRepository

func NewUsersRepository(conn db.Connection) UsersRepository

NewUsersRepository takes a db.Connection and returns a UsersRepository

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL