storage

package
v0.0.0-...-9864ad6 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2017 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseDB

func CloseDB() bool

CloseDB closes the current DB connection. Returns true if closed successfully.

func GetDB

func GetDB() *gorm.DB

GetDB retrieve the DB connection pool

func IsDBConnectionAvailable

func IsDBConnectionAvailable() bool

IsDBConnectionAvailable checks if DB connection is available. Returns true if connection is available else false

func ReInitDBConnection

func ReInitDBConnection()

ReInitDBConnection allows the DB connection to be re-initialized

Types

type SessionModel

type SessionModel struct {
	gorm.Model
	UserModelID             uint      // Foreign Key to UserModel
	UserModel               UserModel // Convenient Method for load related user from model directly
	SessionID               string    `gorm:"not null;unique"`
	DevicePreferenceIndex   uint8
	ExpiryTime              time.Time
	ReplyToConnectionString string
}

SessionModel represents a Session of a User

type UserModel

type UserModel struct {
	gorm.Model
	Username    string `gorm:"not null;unique"`
	DisplayName string
	Email       string `gorm:"not null;unique"`
}

UserModel represents the UserProfile in storage

Jump to

Keyboard shortcuts

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