dao

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DAO

type DAO struct {
	Hosts    string
	Name     string
	User     string
	Password string
	TLS      bool
}
var Dao *DAO

func (*DAO) Connect

func (m *DAO) Connect()

Establish a connection to database

func (*DAO) DeleteReferral

func (m *DAO) DeleteReferral(ref models.Referral) error

Delete an existing referral

func (*DAO) DeleteUser

func (m *DAO) DeleteUser(user models.User) error

Delete an existing user

func (*DAO) FindReferralByCode

func (m *DAO) FindReferralByCode(code string) (models.Referral, error)

Find a referral by code

func (*DAO) FindUserById

func (m *DAO) FindUserById(id string) (models.User, error)

Find a user by id

func (*DAO) FindUserByIdentity

func (m *DAO) FindUserByIdentity(id models.Identity) (models.User, error)

Find a user by email

func (*DAO) FindUserByUsername

func (m *DAO) FindUserByUsername(un string) (models.User, error)

Find a user by username

func (*DAO) Index

func (m *DAO) Index()

func (*DAO) InsertReferral

func (m *DAO) InsertReferral(ref models.Referral) error

Insert a new referral

func (*DAO) InsertUser

func (m *DAO) InsertUser(user models.User) error

Insert a new user

func (*DAO) ListUnusedReferrals

func (m *DAO) ListUnusedReferrals() ([]models.Referral, error)

List referrals

func (*DAO) UpdateReferral

func (m *DAO) UpdateReferral(ref models.Referral) error

Update an existing referral

func (*DAO) UpdateUser

func (m *DAO) UpdateUser(user models.User) error

Update an existing user

Jump to

Keyboard shortcuts

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