dao

package
v0.0.0-...-9a11bf0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBase

type DBase interface {
	Create(userIn models.User) (userOut models.User, err error)
	UserFromId(id string) (user models.User, err error)
	UsernameTaken(u *models.User) (err error)
	UserFromName(name string) (user models.User, err error)
}

type MongoDB

type MongoDB struct {
	Uri string
}

func NewMongoDB

func NewMongoDB(uri string) (db *MongoDB, err error)

func (*MongoDB) Create

func (m *MongoDB) Create(userIn models.User) (userOut models.User, err error)

func (*MongoDB) UserFromId

func (m *MongoDB) UserFromId(id string) (user models.User, err error)

func (*MongoDB) UserFromName

func (m *MongoDB) UserFromName(name string) (user models.User, err error)

func (*MongoDB) UsernameTaken

func (m *MongoDB) UsernameTaken(u *models.User) (err error)

type TestDB

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

func NewTestDB

func NewTestDB() *TestDB

func (*TestDB) Create

func (t *TestDB) Create(userIn models.User) (userOut models.User, err error)

func (*TestDB) UserFromId

func (t *TestDB) UserFromId(id string) (user models.User, err error)

func (*TestDB) UserFromName

func (t *TestDB) UserFromName(name string) (user models.User, err error)

func (*TestDB) UsernameTaken

func (t *TestDB) UsernameTaken(u *models.User) (err error)

Jump to

Keyboard shortcuts

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