sqlstore

package
v0.0.0-...-a61ba57 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2020 License: GPL-3.0 Imports: 8 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) (*gorm.DB, func(...string))

TestDB ...

Types

type Store

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

Store is the struct of db

func New

func New(db *gorm.DB) *Store

New is Creating new Store

func (*Store) User

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

User returning UserRepository inteface

type UserRepository

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

UserRepository a struct with store

func (*UserRepository) ClaimToken

func (r *UserRepository) ClaimToken(u *model.User, token string)

ClaimToken set a new token to db

func (*UserRepository) Create

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

Create a user row in db

func (*UserRepository) CreateProfile

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

CreateProfile ctreating a profile

func (*UserRepository) EditAbout

func (r *UserRepository) EditAbout(id int, about string) error

EditAbout editing about

func (*UserRepository) EditPass

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

EditPass changing a password to new

func (*UserRepository) FindByEmail

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

FindByEmail finding user in DB by email-addr

func (*UserRepository) GetProfile

func (r *UserRepository) GetProfile(email string) *model.Profile

GetProfile Getting profile

func (*UserRepository) GetToken

func (r *UserRepository) GetToken(token string) (string, error)

GetToken is checking token in db

Jump to

Keyboard shortcuts

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