models

package
v0.0.0-...-b7e27c4 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

DB connection

Functions

func Connector

func Connector() *gorm.DB

Connector DB

Types

type Answer

type Answer struct {
	gorm.Model
	TextAnswer  string
	UserRef     uint
	QuestionRef uint
}

Answer DB table

type Question

type Question struct {
	gorm.Model
	TextQuestion string
	UserRefer    uint
}

Question DB table

type User

type User struct {
	gorm.Model
	Username  string     `json:"username" gorm:"size=255"`
	Age       int        `json:"age"`
	Questions []Question `json:"questions" gorm:"foreignkey=UserID"`
}

User DB table

Jump to

Keyboard shortcuts

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