Documentation ¶ Index ¶ Variables func ConnectDB() type Post Constants ¶ This section is empty. Variables ¶ View Source var DBClient *gorm.DB DBClient 连接单例 Functions ¶ func ConnectDB ¶ func ConnectDB() ConnectDB 建立连接 Types ¶ type Post ¶ type Post struct { gorm.Model UUID string `gorm:"index;type:varchar(36)"` Name string Content string Excerpt *string `gorm:"type:varchar(255)"` // Optional field name } Source Files ¶ View all Source files driver.go schema.go Click to show internal directories. Click to hide internal directories.