database

package
v0.0.0-...-209a157 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DbConn *gorm.DB = nil

conn is a singleton object that store db connection

Functions

func CreateStatMsg

func CreateStatMsg(current StatData) string

func InitDatabase

func InitDatabase(dsn string) error

InitDatabase is a function that initializes database connection with provided connection information

func MigrateDb

func MigrateDb()

Types

type NewsData

type NewsData struct {
	gorm.Model
	PostId     int
	Title      string
	Department string
	Link       string
}

func GetLastNews

func GetLastNews() NewsData

func GetRecentNews

func GetRecentNews() []NewsData

func (NewsData) Create

func (d NewsData) Create()

type StatData

type StatData struct {
	gorm.Model
	Confirmed      int
	ConfirmedIncr  string
	Cured          int
	CuredIncr      string
	Death          int
	DeathIncr      string
	Checking       int
	Patients       int
	PatientsIncr   string
	ResultNegative int
}

func GetLastStat

func GetLastStat() StatData

func (StatData) Create

func (d StatData) Create()

Jump to

Keyboard shortcuts

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