database

package
v0.0.0-...-f3b85f2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

func (Database) GetDatabase

func (db Database) GetDatabase() *Database

type DatabaseHandler

type DatabaseHandler interface {
	GetDatabase() *Database
}

func NewDatabaseHandler

func NewDatabaseHandler(dbHost string, dbPort string, dbName string, dbUser string, dbPassword string) (DatabaseHandler, error)

type Fact

type Fact struct {
	Database
	gorm.Model
	Text     string `json:"Text,omitempty"`
	Category string `json:"Category,omitempty"`
	Source   string `json:"Source,omitempty"`
	Approved bool   `json:"Approved,omitempty"`
}

func (*Fact) Create

func (f *Fact) Create() error

func (*Fact) Delete

func (f *Fact) Delete() error

func (*Fact) GetRandomFactId

func (f *Fact) GetRandomFactId() (uint, error)

func (*Fact) Read

func (f *Fact) Read() error

func (*Fact) Update

func (f *Fact) Update() error

type FactId

type FactId struct {
	ID uint `gorm:"primarykey"`
}

type User

type User struct {
	Database
	gorm.Model
	Username string `gorm:"size:255;not null;unique" json:"username"`
	Password string `gorm:"size:255;not null;" json:"password"`
}

func (*User) CheckLogin

func (u *User) CheckLogin() error

Jump to

Keyboard shortcuts

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