models

package
v0.0.0-...-8e2a637 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DB

func DB() *gorm.DB

DB returns the database instance

Types

type DBInstance

type DBInstance struct {
	Initializer func() *gorm.DB
	// contains filtered or unexported fields
}

DBInstance is a singleton DB instance

func (*DBInstance) Instance

func (i *DBInstance) Instance() interface{}

Instance gets the singleton instance

type User

type User struct {
	ID        uint      `gorm:"primary_key" json:"id"`
	Username  string    `json:"username"`
	Email     string    `json:"email"`
	Password  string    `json:"-"`
	CreatedAt time.Time `json:"-"`
	UpdatedAt time.Time `json:"-"`
}

User the user model

func (User) TableName

func (User) TableName() string

TableName for gorm

Jump to

Keyboard shortcuts

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