Documentation ¶ Index ¶ func GetDB(dbName string) *gorm.DB func GetDefault() *gorm.DB func Init() error func SetDB(dbName string, db *gorm.DB) type Example func (dao *Example) Create(example *Example) error func (dao *Example) TableName() string Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func GetDB ¶ func GetDB(dbName string) *gorm.DB func GetDefault ¶ func GetDefault() *gorm.DB func Init ¶ func Init() error func SetDB ¶ func SetDB(dbName string, db *gorm.DB) Types ¶ type Example ¶ type Example struct { gorm.Model Title string `gorm:"column:title"` Text string `gorm:"column:text"` Author string `gorm:"column:author"` PostedOn time.Time `gorm:"column:posted_on"` } func (*Example) Create ¶ func (dao *Example) Create(example *Example) error func (*Example) TableName ¶ func (dao *Example) TableName() string Source Files ¶ View all Source files example.go init.go Click to show internal directories. Click to hide internal directories.