model

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DBIsReady bool

Functions

func Close

func Close() error

func GetSelfDB

func GetSelfDB() (*gorm.DB, error)

func Init

func Init() error

func InitSelfDB

func InitSelfDB() (*gorm.DB, error)

Types

type BaseModel

type BaseModel struct {
	Id        uint64    `gorm:"column:id" json:"id"`
	CreatedAt time.Time `gorm:"column:created_at" json:"-"`
	UpdatedAt time.Time `gorm:"column:updated_at" json:"-"`
}

type Database

type Database struct {
	Self *gorm.DB
}
var DB *Database

type Model

type Model struct {
	ID        uint64         `gorm:"primarykey;autoIncrement" json:"id"`
	CreatedAt time.Time      `json:"-"`
	UpdatedAt time.Time      `json:"-"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}

type Token

type Token struct {
	Token string `json:"token"`
}

Token represents a json web token

Jump to

Keyboard shortcuts

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