database

package
v0.0.0-...-4e531a8 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FlashCardDB

type FlashCardDB interface {
	InitDB(dataSourceURI string, DBName string)
	GetDBUsers() ([]domain.User, bool)
	GetUserFromDB(userName string) (domain.User, bool)
	AddUsersToDB([]domain.User) bool
	UpdateUserInDB(user domain.User) (domain.User, bool)
	DeleteUserFromDB(user domain.User) bool
	GetDB() RealDB
	SetDB(DB RealDB)
	SetRoleOfUsersInDB(users []domain.User) bool
}

type MongoDB

type MongoDB struct {
	DB RealDB
}

func (*MongoDB) AddUsersToDB

func (m *MongoDB) AddUsersToDB(users []domain.User) bool

func (*MongoDB) DeleteUserFromDB

func (m *MongoDB) DeleteUserFromDB(user domain.User) bool

func (*MongoDB) GetDB

func (m *MongoDB) GetDB() RealDB

func (*MongoDB) GetDBUsers

func (m *MongoDB) GetDBUsers() ([]domain.User, bool)

func (*MongoDB) GetUserFromDB

func (m *MongoDB) GetUserFromDB(userName string) (domain.User, bool)

func (*MongoDB) InitDB

func (m *MongoDB) InitDB(dataSourceURI string, DBName string)

func (*MongoDB) SetDB

func (m *MongoDB) SetDB(DB RealDB)

func (*MongoDB) SetRoleOfUsersInDB

func (m *MongoDB) SetRoleOfUsersInDB(users []domain.User) bool

func (*MongoDB) UpdateUserInDB

func (m *MongoDB) UpdateUserInDB(user domain.User) (domain.User, bool)

type MySQLDB

type MySQLDB struct {
	DB   RealDB
	Test string
}

func (*MySQLDB) AddUsersToDB

func (m *MySQLDB) AddUsersToDB(users []domain.User) bool

func (*MySQLDB) DeleteUserFromDB

func (m *MySQLDB) DeleteUserFromDB(user domain.User) bool

func (*MySQLDB) DeleteUserRolesFromDB

func (m *MySQLDB) DeleteUserRolesFromDB(user domain.User) bool

func (*MySQLDB) GetDB

func (m *MySQLDB) GetDB() RealDB

func (*MySQLDB) GetDBUsers

func (m *MySQLDB) GetDBUsers() ([]domain.User, bool)

func (*MySQLDB) GetUserFromDB

func (m *MySQLDB) GetUserFromDB(userName string) (domain.User, bool)

func (*MySQLDB) InitDB

func (m *MySQLDB) InitDB(dataSourceURI string, DBName string)

func (*MySQLDB) SetDB

func (m *MySQLDB) SetDB(DB RealDB)

func (*MySQLDB) SetRoleFromDB

func (m *MySQLDB) SetRoleFromDB(user *domain.User) bool

func (*MySQLDB) SetRoleOfUsersInDB

func (m *MySQLDB) SetRoleOfUsersInDB(users []domain.User) bool

func (*MySQLDB) SetRolesOfDBUsers

func (m *MySQLDB) SetRolesOfDBUsers(users map[string]*domain.User)

func (*MySQLDB) UpdateUserInDB

func (m *MySQLDB) UpdateUserInDB(user domain.User) (domain.User, bool)

type RealDB

type RealDB struct {
	SqlDBConnection   *sql.DB
	MongoDBConnection *mongo.Database
}

Jump to

Keyboard shortcuts

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