daos

package
v0.0.0-...-47332bf Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UserDAO

type UserDAO struct {
	DB *gorm.DB
}

UserDAO persists user data in database

func NewUserDAO

func NewUserDAO(c *libs.AppContext) *UserDAO

NewUserDAO creates a new UserDAO

func (*UserDAO) Create

func (dao *UserDAO) Create(user *models.User) error

Create create a new user into DB

func (*UserDAO) Find

func (dao *UserDAO) Find(id uint) (*models.User, error)

Find does the actual query to database, if user with specified id is not found error is returned

func (*UserDAO) FindAll

func (dao *UserDAO) FindAll() (*[]models.User, error)

FindAll returns all the users from DB

Jump to

Keyboard shortcuts

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