mdb

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CHAndPassword

func CHAndPassword(lH string, lS string) bool

CHAndPassword compares a bcrypt hashed password with its possible plaintext equivalent.

func GFromPassword

func GFromPassword(ls string) string

GFromPassword returns the bcrypt hash of the password at the given cost.

Types

type TXDBS

type TXDBS struct {
	DB      *mongo.Database
	Client  *mongo.Client
	Context context.Context
}

TXDBS is a wrapper for the mongo-go-driver.

func Connect

func Connect(connection, dbname string) (*TXDBS, error)

Connect connect to database used by the mongo-go-driver.

func (*TXDBS) AddAccount

func (sDB *TXDBS) AddAccount(lT *model.Account) *model.Account

AddAccount Insert a Account

func (*TXDBS) AddAuxFun

func (sDB *TXDBS) AddAuxFun(lT *model.AuxFun) *model.AuxFun

AddAuxFun Insert a AuxFun

func (*TXDBS) AddClient

func (sDB *TXDBS) AddClient(lT *model.Client) *model.Client

AddClient Insert a Client

func (*TXDBS) AddDiagnosis

func (sDB *TXDBS) AddDiagnosis(lT *model.Diagnosis) *model.Diagnosis

AddDiagnosis Insert a Diagnosis

func (*TXDBS) AddFault

func (sDB *TXDBS) AddFault(lT *model.Fault) *model.Fault

AddFault Insert a Fault

func (*TXDBS) AddHost

func (sDB *TXDBS) AddHost(lT *model.Host) *model.Host

AddHost Insert a Host

func (*TXDBS) AddIssue

func (sDB *TXDBS) AddIssue(lT *model.Issue) *model.Issue

AddIssue Insert a Issue

func (*TXDBS) AddLayout

func (sDB *TXDBS) AddLayout(lT *model.Layout) *model.Layout

AddLayout Insert a Layout

func (*TXDBS) AddLocation

func (sDB *TXDBS) AddLocation(lT *model.Location) *model.Location

AddLocation Insert a Location

func (*TXDBS) AddMold

func (sDB *TXDBS) AddMold(lT *model.Mold) *model.Mold

AddMold Insert a Mold

func (*TXDBS) AddMoldFun

func (sDB *TXDBS) AddMoldFun(lT *model.MoldFun) *model.MoldFun

AddMoldFun Insert a MoldFun

func (*TXDBS) AddMonitor

func (sDB *TXDBS) AddMonitor(lT *model.Monitor) *model.Monitor

AddMonitor Insert a Monitor

func (*TXDBS) AddNotice

func (sDB *TXDBS) AddNotice(lT *model.Notice) *model.Notice

AddNotice Insert a Notice

func (*TXDBS) AddNoticeFun

func (sDB *TXDBS) AddNoticeFun(lT *model.NoticeFun) *model.NoticeFun

AddNoticeFun Insert a NoticeFun

func (*TXDBS) AddPPLogs

func (sDB *TXDBS) AddPPLogs(lT *model.PPLogs) *model.PPLogs

AddPPLogs Insert a PPLogs

func (*TXDBS) AddPermissions

func (sDB *TXDBS) AddPermissions(lT *model.Permissions) *model.Permissions

AddPermissions Insert a Permissions

func (*TXDBS) AddRole

func (sDB *TXDBS) AddRole(lT *model.Role) *model.Role

AddRole Insert a Role

func (*TXDBS) AddSignin

func (sDB *TXDBS) AddSignin(lT *model.Signin) *model.Signin

AddSignin Insert a Signin

func (*TXDBS) AddStudent

func (sDB *TXDBS) AddStudent(lT *model.Student) *model.Student

AddStudent Insert a Student

func (*TXDBS) AddSurvey

func (sDB *TXDBS) AddSurvey(lT *model.Survey) *model.Survey

AddSurvey Insert a Survey

func (*TXDBS) AddTerminal

func (sDB *TXDBS) AddTerminal(lT *model.Terminal) *model.Terminal

AddTerminal Insert a Terminal

func (*TXDBS) AddUniversity

func (sDB *TXDBS) AddUniversity(lT *model.University) *model.University

AddUniversity Insert a University

func (*TXDBS) Close

func (d *TXDBS) Close()

Close closes the connect used by the mongo-go-driver.

func (*TXDBS) CountAccount

func (sDB *TXDBS) CountAccount() string

CountAccount returns the Account counts

func (*TXDBS) CountAuxFun

func (sDB *TXDBS) CountAuxFun() string

CountAuxFun returns the AuxFun counts

func (*TXDBS) CountClient

func (sDB *TXDBS) CountClient() string

CountClient returns the Client counts

func (*TXDBS) CountDiagnosis

func (sDB *TXDBS) CountDiagnosis() string

CountDiagnosis returns the Diagnosis counts

func (*TXDBS) CountFault

func (sDB *TXDBS) CountFault() string

CountFault returns the Fault counts

func (*TXDBS) CountHost

func (sDB *TXDBS) CountHost() string

CountHost returns the Host counts

func (*TXDBS) CountIssue

func (sDB *TXDBS) CountIssue() string

CountIssue returns the Issue counts

func (*TXDBS) CountLayout

func (sDB *TXDBS) CountLayout() string

CountLayout returns the Layout counts

func (*TXDBS) CountLocation

func (sDB *TXDBS) CountLocation() string

CountLocation returns the Location counts

func (*TXDBS) CountMold

func (sDB *TXDBS) CountMold() string

CountMold returns the Mold counts

func (*TXDBS) CountMoldFun

func (sDB *TXDBS) CountMoldFun() string

CountMoldFun returns the MoldFun counts

func (*TXDBS) CountMonitor

func (sDB *TXDBS) CountMonitor() string

CountMonitor returns the Monitor counts

func (*TXDBS) CountNotice

func (sDB *TXDBS) CountNotice() string

CountNotice returns the Notice counts

func (*TXDBS) CountNoticeFun

func (sDB *TXDBS) CountNoticeFun() string

CountNoticeFun returns the NoticeFun counts

func (*TXDBS) CountPPLogs

func (sDB *TXDBS) CountPPLogs() string

CountPPLogs returns the PPLogs counts

func (*TXDBS) CountPermissions

func (sDB *TXDBS) CountPermissions() string

CountPermissions returns the Permissions counts

func (*TXDBS) CountRole

func (sDB *TXDBS) CountRole() string

CountRole returns the Role counts

func (*TXDBS) CountSignin

func (sDB *TXDBS) CountSignin() string

CountSignin returns the Signin counts

func (*TXDBS) CountStudent

func (sDB *TXDBS) CountStudent() string

CountStudent returns the Student counts

func (*TXDBS) CountSurvey

func (sDB *TXDBS) CountSurvey() string

CountSurvey returns the Survey counts

func (*TXDBS) CountTerminal

func (sDB *TXDBS) CountTerminal() string

CountTerminal returns the Terminal counts

func (*TXDBS) CountUniversity

func (sDB *TXDBS) CountUniversity() string

CountUniversity returns the University counts

func (*TXDBS) DeleteAccount

func (sDB *TXDBS) DeleteAccount(uid primitive.ObjectID) error

DeleteAccount deletes a Account by its id.

func (*TXDBS) DeleteAuxFun

func (sDB *TXDBS) DeleteAuxFun(uid primitive.ObjectID) error

DeleteAuxFun deletes a AuxFun by its id.

func (*TXDBS) DeleteClient

func (sDB *TXDBS) DeleteClient(uid primitive.ObjectID) error

DeleteClient deletes a Client by its id.

func (*TXDBS) DeleteDiagnosis

func (sDB *TXDBS) DeleteDiagnosis(uid primitive.ObjectID) error

DeleteDiagnosis deletes a Diagnosis by its id.

func (*TXDBS) DeleteFault

func (sDB *TXDBS) DeleteFault(uid primitive.ObjectID) error

DeleteFault deletes a Fault by its id.

func (*TXDBS) DeleteHost

func (sDB *TXDBS) DeleteHost(uid primitive.ObjectID) error

DeleteHost deletes a Host by its id.

func (*TXDBS) DeleteIssue

func (sDB *TXDBS) DeleteIssue(uid primitive.ObjectID) error

DeleteIssue deletes a Issue by its id.

func (*TXDBS) DeleteLayout

func (sDB *TXDBS) DeleteLayout(uid primitive.ObjectID) error

DeleteLayout deletes a Layout by its id.

func (*TXDBS) DeleteLocation

func (sDB *TXDBS) DeleteLocation(uid primitive.ObjectID) error

DeleteLocation deletes a Location by its id.

func (*TXDBS) DeleteMold

func (sDB *TXDBS) DeleteMold(uid primitive.ObjectID) error

DeleteMold deletes a Mold by its id.

func (*TXDBS) DeleteMoldFun

func (sDB *TXDBS) DeleteMoldFun(uid primitive.ObjectID) error

DeleteMoldFun deletes a MoldFun by its id.

func (*TXDBS) DeleteMonitor

func (sDB *TXDBS) DeleteMonitor(uid primitive.ObjectID) error

DeleteMonitor deletes a Monitor by its id.

func (*TXDBS) DeleteNotice

func (sDB *TXDBS) DeleteNotice(uid primitive.ObjectID) error

DeleteNotice deletes a Notice by its id.

func (*TXDBS) DeleteNoticeFun

func (sDB *TXDBS) DeleteNoticeFun(uid primitive.ObjectID) error

DeleteNoticeFun deletes a NoticeFun by its id.

func (*TXDBS) DeletePPLogs

func (sDB *TXDBS) DeletePPLogs(uid primitive.ObjectID) error

DeletePPLogs deletes a PPLogs by its id.

func (*TXDBS) DeletePermissions

func (sDB *TXDBS) DeletePermissions(uid primitive.ObjectID) error

DeletePermissions deletes a Permissions by its id.

func (*TXDBS) DeleteRole

func (sDB *TXDBS) DeleteRole(uid primitive.ObjectID) error

DeleteRole deletes a Role by its id.

func (*TXDBS) DeleteSignin

func (sDB *TXDBS) DeleteSignin(uid primitive.ObjectID) error

DeleteSignin deletes a Signin by its id.

func (*TXDBS) DeleteStudent

func (sDB *TXDBS) DeleteStudent(uid primitive.ObjectID) error

DeleteStudent deletes a Student by its id.

func (*TXDBS) DeleteSurvey

func (sDB *TXDBS) DeleteSurvey(uid primitive.ObjectID) error

DeleteSurvey deletes a Survey by its id.

func (*TXDBS) DeleteTerminal

func (sDB *TXDBS) DeleteTerminal(uid primitive.ObjectID) error

DeleteTerminal deletes a Terminal by its id.

func (*TXDBS) DeleteUniversity

func (sDB *TXDBS) DeleteUniversity(uid primitive.ObjectID) error

DeleteUniversity deletes a University by its id.

func (*TXDBS) FindRole

func (sDB *TXDBS) FindRole(Auth uint) *model.Role

FindRole returns a Role by Auth.

func (*TXDBS) GetAccount

func (sDB *TXDBS) GetAccount() []*model.Account

GetAccount returns all Accounts.

func (*TXDBS) GetAuxFun

func (sDB *TXDBS) GetAuxFun() []*model.AuxFun

GetAuxFun returns all AuxFuns.

func (*TXDBS) GetClient

func (sDB *TXDBS) GetClient() []*model.Client

GetClient returns all Clients.

func (*TXDBS) GetDiagnosis

func (sDB *TXDBS) GetDiagnosis() []*model.Diagnosis

GetDiagnosis returns all Diagnosiss.

func (*TXDBS) GetFault

func (sDB *TXDBS) GetFault() []*model.Fault

GetFault returns all Faults.

func (*TXDBS) GetHost

func (sDB *TXDBS) GetHost() []*model.Host

GetHost returns all Hosts.

func (*TXDBS) GetIssue

func (sDB *TXDBS) GetIssue() []*model.Issue

GetIssue returns all Issues.

func (*TXDBS) GetLayout

func (sDB *TXDBS) GetLayout() []*model.Layout

GetLayout returns all Layouts.

func (*TXDBS) GetLocation

func (sDB *TXDBS) GetLocation() []*model.Location

GetLocation returns all Locations.

func (*TXDBS) GetMold

func (sDB *TXDBS) GetMold() []*model.Mold

GetMold returns all Molds.

func (*TXDBS) GetMoldFun

func (sDB *TXDBS) GetMoldFun() []*model.MoldFun

GetMoldFun returns all MoldFuns.

func (*TXDBS) GetMonitor

func (sDB *TXDBS) GetMonitor() []*model.Monitor

GetMonitor returns all Monitors.

func (*TXDBS) GetNotice

func (sDB *TXDBS) GetNotice() []*model.Notice

GetNotice returns all Notices.

func (*TXDBS) GetNoticeFun

func (sDB *TXDBS) GetNoticeFun() []*model.NoticeFun

GetNoticeFun returns all NoticeFuns.

func (*TXDBS) GetPPLogs

func (sDB *TXDBS) GetPPLogs() []*model.PPLogs

GetPPLogs returns all PPLogss.

func (*TXDBS) GetPermissions

func (sDB *TXDBS) GetPermissions() []*model.Permissions

GetPermissions returns all Permissionss.

func (*TXDBS) GetRole

func (sDB *TXDBS) GetRole() []*model.Role

GetRole returns all Roles.

func (*TXDBS) GetSignin

func (sDB *TXDBS) GetSignin() []*model.Signin

GetSignin returns all Signins.

func (*TXDBS) GetStudent

func (sDB *TXDBS) GetStudent() []*model.Student

GetStudent returns all Students.

func (*TXDBS) GetSurvey

func (sDB *TXDBS) GetSurvey() []*model.Survey

GetSurvey returns all Surveys.

func (*TXDBS) GetTerminal

func (sDB *TXDBS) GetTerminal() []*model.Terminal

GetTerminal returns all Terminals.

func (*TXDBS) GetUniversity

func (sDB *TXDBS) GetUniversity() []*model.University

GetUniversity returns all Universitys.

func (*TXDBS) ImportStudent

func (sDB *TXDBS) ImportStudent(lA []model.Student) []*model.Student

ImportStudent Do FindOneAndUpdate and get all Students.

func (*TXDBS) InitAccount

func (sDB *TXDBS) InitAccount() error

InitAccount InsertMany Accounts.

func (*TXDBS) InitAuxFun

func (sDB *TXDBS) InitAuxFun() error

InitAuxFun InsertMany AuxFun.

func (*TXDBS) InitDiagnosis

func (sDB *TXDBS) InitDiagnosis() error

InitDiagnosis InsertMany Diagnosis.

func (*TXDBS) InitHost

func (sDB *TXDBS) InitHost() error

InitHost InsertMany Hosts.

func (*TXDBS) InitIssue

func (sDB *TXDBS) InitIssue() error

InitIssue InsertMany Issue.

func (*TXDBS) InitLayout

func (sDB *TXDBS) InitLayout() error

InitLayout InsertMany Layouts.

func (*TXDBS) InitMold

func (sDB *TXDBS) InitMold() error

InitMold InsertMany Molds.

func (*TXDBS) InitMoldFun

func (sDB *TXDBS) InitMoldFun() error

InitMoldFun InsertMany MoldFuns.

func (*TXDBS) InitNotice

func (sDB *TXDBS) InitNotice() error

InitNotice InsertMany Hosts.

func (*TXDBS) InitNoticeFun

func (sDB *TXDBS) InitNoticeFun() error

InitNoticeFun InsertMany NoticeFun.

func (*TXDBS) InitPermissions

func (sDB *TXDBS) InitPermissions() error

InitPermissions InsertMany Permissionss.

func (*TXDBS) InitRole

func (sDB *TXDBS) InitRole() error

InitRole InsertMany Roles.

func (*TXDBS) InitSurvey

func (sDB *TXDBS) InitSurvey() error

InitSurvey InsertMany Survey.

func (*TXDBS) LoginAccount

func (sDB *TXDBS) LoginAccount(account string, password string) *model.Account

LoginAccount returns the Account by the given account and password or nil.

func (*TXDBS) LoginStudent

func (sDB *TXDBS) LoginStudent(SNo string, Password string) *model.Student

LoginStudent returns the Student by the given SNo and Password or nil.

func (*TXDBS) LoginTerminal

func (sDB *TXDBS) LoginTerminal(label string, ip string) *model.Terminal

LoginTerminal returns the Terminal by the given label and ip or nil.

func (*TXDBS) Signout

func (sDB *TXDBS) Signout(uid primitive.ObjectID) error

Signout updates a Signin.

func (*TXDBS) UpdateAccount

func (sDB *TXDBS) UpdateAccount(lT *model.Account) *model.Account

UpdateAccount updates a Account.

func (*TXDBS) UpdateAccountPassword

func (sDB *TXDBS) UpdateAccountPassword(lT *model.Account) *model.Account

UpdateAccountPassword updates a Account's Password.

func (*TXDBS) UpdateAuxFun

func (sDB *TXDBS) UpdateAuxFun(lT *model.AuxFun) *model.AuxFun

UpdateAuxFun updates a AuxFun.

func (*TXDBS) UpdateClient

func (sDB *TXDBS) UpdateClient(lT *model.Client) *model.Client

UpdateClient updates a Client.

func (*TXDBS) UpdateDiagnosis

func (sDB *TXDBS) UpdateDiagnosis(lT *model.Diagnosis) *model.Diagnosis

UpdateDiagnosis updates a Diagnosis.

func (*TXDBS) UpdateFault

func (sDB *TXDBS) UpdateFault(lT *model.Fault) *model.Fault

UpdateFault updates a Fault.

func (*TXDBS) UpdateHost

func (sDB *TXDBS) UpdateHost(lT *model.Host) *model.Host

UpdateHost updates a Host.

func (*TXDBS) UpdateIssue

func (sDB *TXDBS) UpdateIssue(lT *model.Issue) *model.Issue

UpdateIssue updates a Issue.

func (*TXDBS) UpdateLayout

func (sDB *TXDBS) UpdateLayout(lT *model.Layout) *model.Layout

UpdateLayout updates a Layout.

func (*TXDBS) UpdateLocation

func (sDB *TXDBS) UpdateLocation(lT *model.Location) *model.Location

UpdateLocation updates a Location.

func (*TXDBS) UpdateMold

func (sDB *TXDBS) UpdateMold(lT *model.Mold) *model.Mold

UpdateMold updates a Mold.

func (*TXDBS) UpdateMoldFun

func (sDB *TXDBS) UpdateMoldFun(lT *model.MoldFun) *model.MoldFun

UpdateMoldFun updates a MoldFun.

func (*TXDBS) UpdateMonitor

func (sDB *TXDBS) UpdateMonitor(lT *model.Monitor) *model.Monitor

UpdateMonitor updates a Monitor.

func (*TXDBS) UpdateNotice

func (sDB *TXDBS) UpdateNotice(lT *model.Notice) *model.Notice

UpdateNotice updates a Notice.

func (*TXDBS) UpdateNoticeFun

func (sDB *TXDBS) UpdateNoticeFun(lT *model.NoticeFun) *model.NoticeFun

UpdateNoticeFun updates a NoticeFun.

func (*TXDBS) UpdatePPLogs

func (sDB *TXDBS) UpdatePPLogs(lT *model.PPLogs) *model.PPLogs

UpdatePPLogs updates a PPLogs.

func (*TXDBS) UpdatePermissions

func (sDB *TXDBS) UpdatePermissions(lT *model.Permissions) *model.Permissions

UpdatePermissions updates a Permissions.

func (*TXDBS) UpdateRole

func (sDB *TXDBS) UpdateRole(lT *model.Role) *model.Role

UpdateRole updates a Role.

func (*TXDBS) UpdateStudent

func (sDB *TXDBS) UpdateStudent(lT *model.Student) *model.Student

UpdateStudent updates a Student.

func (*TXDBS) UpdateSurvey

func (sDB *TXDBS) UpdateSurvey(lT *model.Survey) *model.Survey

UpdateSurvey updates a Survey.

func (*TXDBS) UpdateTerminal

func (sDB *TXDBS) UpdateTerminal(lT *model.Terminal) *model.Terminal

UpdateTerminal updates a Terminal.

func (*TXDBS) UpdateUniversity

func (sDB *TXDBS) UpdateUniversity(lT *model.University) *model.University

UpdateUniversity updates a University.

Jump to

Keyboard shortcuts

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