model

package
v0.0.0-...-a91c245 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2019 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoMigrateDatabase

func AutoMigrateDatabase()

func CloseDB

func CloseDB(_db *gorm.DB)

func OpenDB

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

Types

type Application

type Application struct {
	GModel     gorm.Model `gorm:"embedded"`
	AppName    string     `gorm:"column:app_name;type:varchar(32);unique;not null"`
	AppKey     string     `gorm:"column:app_key;type:char(32);unique;not null"`
	AppSecret  string     `gorm:"column:app_secret;type:char(32);unique;not null"`
	PublicKey  string     `gorm:"column:key_public;type:TEXT;not null"`
	PrivateKey string     `gorm:"column:key_private;type:TEXT;not null"`
	Profile    string     `gorm:"column:profile;type:TEXT"`
}

func (Application) TableName

func (Application) TableName() string

type Key

type Key struct {
	GModel   gorm.Model `gorm:"embedded"`
	AppName  string     `gorm:"column:app_name;type:varchar(32);not null"`
	Number   string     `gorm:"column:number;type:char(32);unique;not null"`
	Capacity int        `gorm:"column:capacity;not null;default:1"`
	Expiry   int        `gorm:"column:expiry;not null;default:0"`
	Status   int        `gorm:"column:status;not null;default:0"`
	Storage  string     `gorm:"column:storage"`
	Profile  string     `gorm:"column:profile;type:TEXT"`
}

func (Key) TableName

func (Key) TableName() string

type License

type License struct {
	GModel  gorm.Model `gorm:"embedded"`
	UID     string     `gorm:"column:uid;type:char(32);unique;not null"`
	Number  string     `gorm:"column:number;type:char(32);not null"`
	Code    string     `gorm:"column:code;type:varchar(64);not null"`
	License string     `gorm:"column:license;type:TEXT;not null"`
}

func (License) TableName

func (License) TableName() string

Jump to

Keyboard shortcuts

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