Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DB gorm.DB
Functions ¶
func GenerateAnonymousUser ¶
func GenerateAnonymousUser() sessionauth.User
Types ¶
type Category ¶
type Category struct { Model Name string `sql:"type:varchar(255);not null"` // gin index Yomi string `sql:"type:varchar(255);"` // gin index Romaji string `sql:"type:varchar(128)"` Gyou string `sql:"type:varchar(6);index"` Prefix string `sql:"type:varchar(16);unique;not null"` Image *Image ImageID sql.NullInt64 `sql:"index"` Dicts []*Dict }
func (*Category) LatestDicts ¶
func (*Category) ModifiedDicts ¶
type Comment ¶
type Comment struct { Model Title string `sql:"type:varchar(64)" form:"title"` // gin index Comment string `sql:"type:text;not null" form:"comment" binding:"required"` // gin index CommentHTML string `sql:"type:text;not null" form:"-"` Role string `sql:"type:varchar(32);index;default:'public'" form:"-"` ObjectID int64 `sql:"index" form:"-"` ObjectType string `sql:"index" form:"-"` User *User UserID sql.NullInt64 `sql:"index" form:"-"` }
func (*Comment) BeforeSave ¶
type Dict ¶
type Dict struct { Model Name string `sql:"type:varchar(255);unique;not null"` // gin index Yomi string `sql:"type:varchar(255);"` // gin index Romaji string `sql:"type:varchar(128)"` Gyou string `sql:"type:varchar(6);index"` Content string `sql:"type:text"` // gin index ContentHTML string `sql:"type:text"` // gin index Prefix string `sql:"type:varchar(16);index;not null"` Image *Image ImageID sql.NullInt64 `sql:"index"` Category *Category CategoryID sql.NullInt64 `sql:"index"` Tags []*Tag `gorm:"many2many:dict_tags"` Comments []*Comment `gorm:"polymorphic:Object;"` }
func (*Dict) AfterCreate ¶
func (*Dict) BeforeCreate ¶
func (*Dict) BeforeSave ¶
func (*Dict) TagsLoader ¶
func (m *Dict) TagsLoader()
type Image ¶
type Image struct { Model Name string `sql:"type:varchar(255);not null"` Src string `sql:"type:varchar(255);not null"` Ext string Mime string Width int Height int }
func NewImageByIMG ¶
type Tag ¶
type Tag struct { Model Name string `sql:"type:varchar(255);unique;not null"` // gin index Yomi string `sql:"type:varchar(255);"` // gin index Romaji string `sql:"type:varchar(128)"` Gyou string `sql:"type:varchar(6);index"` Image *Image ImageID sql.NullInt64 `sql:"index"` Dicts []*Dict `gorm:"many2many:dict_tags;"` }
type User ¶
type User struct { Model Email string `sql:"type:varchar(128);not null;unique" form:"email" binding:"required"` Password string `sql:"type:varchar(128);not null" form:"password" binding:"required"` LoggedAt time.Time `form:"-" ` Image *Image ImageID sql.NullInt64 `sql:"index"` Repassword string `sql:"-" form:"repassword"` // contains filtered or unexported fields }
func (*User) IsAuthenticated ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.