Documentation ¶
Index ¶
- Variables
- func CreateAdmin()
- func Init() *gorm.DB
- func Register(username, password string) error
- func Save(object interface{}) error
- func UpdatePost(pid interface{}, attrs map[string]interface{}) error
- func UpdateUser(uid interface{}, attrs map[string]interface{}) error
- type Comment
- type Post
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *gorm.DB
Functions ¶
func CreateAdmin ¶
func CreateAdmin()
func UpdatePost ¶
func UpdateUser ¶
Types ¶
type Post ¶
type Post struct { gorm.Model Title string `json:"title"` Content string `json:"content"` Comments []Comment `json:"comments"` Hidden bool `gorm:"default:false" json:"hidden"` UserID uint `json:"userid"` }
func CreateComment ¶
func FindPostByID ¶
func SearchPost ¶
Click to show internal directories.
Click to hide internal directories.