repository

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2017 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IUserRepositoryInterface

type IUserRepositoryInterface interface {
	Register(user models.User) error
	LogIn(userName, password string) (string, error)
	LogOut(token string) error
	ExistsUsername(userName string) (bool, error)
	ExistsEmail(email string) (bool, error)
	CheckToken(token string) (bool, error)
}

IUserRepositoryInterface interface of the User repo

type UserRepository

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

UserRepository struct implementation of IUserRepositoryInterface

func NewUserRepository

func NewUserRepository(connString string) (*UserRepository, error)

NewUserRepository function to get new UserRepository

func (*UserRepository) CheckToken

func (usr *UserRepository) CheckToken(token string) (bool, error)

CheckToken function

func (*UserRepository) ExistsEmail

func (usr *UserRepository) ExistsEmail(email string) (bool, error)

ExistsEmail function checks if the given email exists

func (*UserRepository) ExistsUsername

func (usr *UserRepository) ExistsUsername(userName string) (bool, error)

ExistsUsername function checks if the given userName exists

func (*UserRepository) LogIn

func (usr *UserRepository) LogIn(userName string, password string) (string, error)

LogIn Logs In the user

func (*UserRepository) LogOut

func (usr *UserRepository) LogOut(token string) error

LogOut function

func (*UserRepository) Register

func (usr *UserRepository) Register(user models.User) error

Register function that registers the given user.

Jump to

Keyboard shortcuts

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