sqlstore

package
v0.0.0-...-e0287d8 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestDB

func TestDB(t *testing.T, databaseURL string) (*sql.DB, func(...string))

TestDB ...

Types

type Store

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

Store object, that is made to store information about DB

func New

func New(db *sql.DB) *Store

New func. Constructor for Store object

func (*Store) User

func (s *Store) User() store.UserRepository

User func. If userrepository is nil assigns it with pointer on UserRepository which is initialised with calling store.

type UserRepository

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

UserRepository object for storing store entities

func (*UserRepository) Create

func (r *UserRepository) Create(u *model.User) error

Create func. Writing an email and encrypted password in the fields in DB that match to imported User.

func (*UserRepository) Find

func (r *UserRepository) Find(id int) (*model.User, error)

Find func. Finding user with the right (id we need) id

func (*UserRepository) FindByEmail

func (r *UserRepository) FindByEmail(email string) (*model.User, error)

FindByEmail func. Finding user with the right (email we need) email

Jump to

Keyboard shortcuts

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