entity

package
Version: v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2019 License: GPL-3.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDBWithModel

func GetDBWithModel(ctx context.Context, defDB *gorm.DB, m interface{}) *gorm.DB

func GetTablePrefix

func GetTablePrefix() string

GetTablePrefix - Get the table name prefix

func SetTablePrefix

func SetTablePrefix(prefix string)

SetTablePrefix - Set the table name prefix

func ToString

func ToString(v interface{}) string

Types

type Model

type Model struct {
	ID        uint       `gorm:"column:id;primary_key;auto_increment;"`
	CreatedAt time.Time  `gorm:"column:created_at;"`
	UpdatedAt time.Time  `gorm:"column:updated_at;"`
	DeletedAt *time.Time `gorm:"column:deleted_at;index;"`
}

Model base model

func (Model) TableName

func (Model) TableName(name string) string

TableName table name

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL