dao

package
v0.0.0-...-4ec5d07 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: Unlicense Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPostgresDB

func NewPostgresDB(dataSourceName string) *sqlx.DB

NewPostgresDB opens a new postgres connection

Types

type UserDAO

type UserDAO struct {
	// contains filtered or unexported fields
}

UserDAO access users in the DB

func NewUserDAO

func NewUserDAO(db sqlxDB) *UserDAO

NewUserDAO new instance of UserDAO

func (UserDAO) FindAll

func (u UserDAO) FindAll(ctx context.Context) ([]UserModel, error)

FindAll returns all the users

type UserModel

type UserModel struct {
	ID   int64  `db:"id"`
	Name string `db:"name"`
}

UserModel DB representation of the user

Jump to

Keyboard shortcuts

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