Documentation ¶
Index ¶
- func Appends() orm.QuerySeter
- func Articles() orm.QuerySeter
- func Categories() orm.QuerySeter
- func CheckIsExist(qs orm.QuerySeter, field string, value interface{}, skipId int) bool
- func Comments() orm.QuerySeter
- func CountObjects(qs orm.QuerySeter) (int64, error)
- func FollowTopics() orm.QuerySeter
- func Follows() orm.QuerySeter
- func GetUserSalt() string
- func ListObjects(qs orm.QuerySeter, objs interface{}) (int64, error)
- func Posts() orm.QuerySeter
- func Topics() orm.QuerySeter
- func Users() orm.QuerySeter
- type AppendPost
- type Article
- func (m *Article) Delete() error
- func (m *Article) GetContentCache(lang string) string
- func (m *Article) GetTitle(lang string) string
- func (m *Article) Insert() error
- func (m *Article) Link() string
- func (m *Article) Read(fields ...string) error
- func (m *Article) String() string
- func (m *Article) Update(fields ...string) error
- type Category
- type Comment
- type FavoritePost
- type Follow
- type FollowTopic
- type Image
- func (m *Image) DecodeToken(token string) error
- func (m *Image) Delete() error
- func (m *Image) GetExt() string
- func (m *Image) GetToken() string
- func (m *Image) Insert() error
- func (m *Image) LinkFull() string
- func (m *Image) LinkMiddle() string
- func (m *Image) LinkSize(width int) string
- func (m *Image) LinkSmall() string
- func (m *Image) Read(fields ...string) error
- func (m *Image) Update(fields ...string) error
- type Post
- func (m *Post) Appends() orm.QuerySeter
- func (m *Post) Comments() orm.QuerySeter
- func (m *Post) Delete() error
- func (m *Post) GetContentCache() string
- func (m *Post) GetLang() string
- func (m *Post) Insert() error
- func (m *Post) Link() string
- func (m *Post) Read(fields ...string) error
- func (m *Post) String() string
- func (m *Post) Update(fields ...string) error
- type Setting
- type SliceStringField
- func (e *SliceStringField) Add(v string)
- func (e *SliceStringField) Clean() error
- func (e *SliceStringField) FieldType() int
- func (e *SliceStringField) RawValue() interface{}
- func (e *SliceStringField) Set(d []string)
- func (e *SliceStringField) SetRaw(value interface{}) error
- func (e *SliceStringField) String() string
- func (e SliceStringField) Value() []string
- type Topic
- func (m *Topic) Delete() error
- func (m *Topic) GetIntro(lang string) string
- func (m *Topic) GetName(lang string) string
- func (m *Topic) Insert() error
- func (m *Topic) Link() string
- func (m *Topic) Read(fields ...string) error
- func (m *Topic) RefreshFollowers() int
- func (m *Topic) String() string
- func (m *Topic) Update(fields ...string) error
- type User
- func (m *User) AvatarLink() string
- func (m *User) Delete() error
- func (m *User) FollowerUsers() orm.QuerySeter
- func (m *User) FollowingUsers() orm.QuerySeter
- func (m *User) Insert() error
- func (m *User) Link() string
- func (m *User) Read(fields ...string) error
- func (m *User) RecentComments() orm.QuerySeter
- func (m *User) RecentPosts() orm.QuerySeter
- func (m *User) RefreshFavTopics() int
- func (m *User) String() string
- func (m *User) Update(fields ...string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Appends ¶
func Appends() orm.QuerySeter
func Articles ¶
func Articles() orm.QuerySeter
func Categories ¶
func Categories() orm.QuerySeter
func CheckIsExist ¶
func CheckIsExist(qs orm.QuerySeter, field string, value interface{}, skipId int) bool
func Comments ¶
func Comments() orm.QuerySeter
func CountObjects ¶
func CountObjects(qs orm.QuerySeter) (int64, error)
func FollowTopics ¶
func FollowTopics() orm.QuerySeter
func Follows ¶
func Follows() orm.QuerySeter
func ListObjects ¶
func ListObjects(qs orm.QuerySeter, objs interface{}) (int64, error)
func Posts ¶
func Posts() orm.QuerySeter
func Topics ¶
func Topics() orm.QuerySeter
func Users ¶
func Users() orm.QuerySeter
Types ¶
type AppendPost ¶
type AppendPost struct { Id int Post *Post `orm:"rel(fk)"` Message string `orm:"type(text)"` MessageCache string `orm:"type(text)"` Created time.Time `orm:"auto_now_add;index"` }
append content for post
func (*AppendPost) Delete ¶
func (m *AppendPost) Delete() error
func (*AppendPost) GetMessageCache ¶
func (m *AppendPost) GetMessageCache() string
func (*AppendPost) Insert ¶
func (m *AppendPost) Insert() error
func (*AppendPost) Read ¶
func (m *AppendPost) Read(fields ...string) error
func (*AppendPost) String ¶
func (m *AppendPost) String() string
func (*AppendPost) Update ¶
func (m *AppendPost) Update(fields ...string) error
type Article ¶
type Article struct { Id int User *User `orm:"rel(fk)"` Uri string `orm:"size(60);unqiue"` Title string `orm:"size(60)"` Content string `orm:"type(text)"` ContentCache string `orm:"type(text)"` TitleZhCn string `orm:"size(60)"` ContentZhCn string `orm:"type(text)"` ContentCacheZhCn string `orm:"type(text)"` LastAuthor *User `orm:"rel(fk);null"` IsPublish bool `orm:"index"` Created time.Time `orm:"auto_now_add"` Updated time.Time `orm:"auto_now"` }
func (*Article) GetContentCache ¶
type Category ¶
type Category struct { Id int Name string `orm:"size(30);unique"` Slug string `orm:"size(100);unique"` Order int `orm:"index"` }
topic category
type Comment ¶
type Comment struct { Id int User *User `orm:"rel(fk)"` Post *Post `orm:"rel(fk)"` Message string `orm:"type(text)"` MessageCache string `orm:"type(text)"` Floor int Status int Duplicated bool `orm:"index"` Created time.Time `orm:"auto_now_add;index"` }
comment content for post
func (*Comment) GetMessageCache ¶
type FavoritePost ¶
type FavoritePost struct { Id int User *User `orm:"rel(fk)"` Post *Post `orm:"rel(fk)"` Created time.Time `orm:"auto_now_add"` }
user favorite posts
func (*FavoritePost) TableUnique ¶
func (*FavoritePost) TableUnique() [][]string
type Follow ¶
type Follow struct { Id int User *User `orm:"rel(fk)"` FollowUser *User `orm:"rel(fk)"` Mutual bool Created time.Time `orm:"auto_now_add"` }
user follow
func (*Follow) TableUnique ¶
type FollowTopic ¶
type FollowTopic struct { Id int User *User `orm:"rel(fk)"` Topic *Topic `orm:"rel(fk)"` Created time.Time `orm:"auto_now_add"` }
user follow topics
func (*FollowTopic) Delete ¶
func (m *FollowTopic) Delete() error
func (*FollowTopic) Insert ¶
func (m *FollowTopic) Insert() error
func (*FollowTopic) Read ¶
func (m *FollowTopic) Read(fields ...string) error
func (*FollowTopic) String ¶
func (m *FollowTopic) String() string
func (*FollowTopic) TableUnique ¶
func (*FollowTopic) TableUnique() [][]string
func (*FollowTopic) Update ¶
func (m *FollowTopic) Update(fields ...string) error
type Image ¶
type Image struct { Id int User *User `orm:"rel(fk)"` Width int Height int Ext int `orm:"index"` Created time.Time }
func (*Image) DecodeToken ¶
func (*Image) LinkMiddle ¶
type Post ¶
type Post struct { Id int User *User `orm:"rel(fk)"` Title string `orm:"size(60)"` Content string `orm:"type(text)"` ContentCache string `orm:"type(text)"` Browsers int `orm:"index"` Replys int `orm:"index"` TodayReplys int `orm:"index"` Favorites int `orm:"index"` LastReply *User `orm:"rel(fk);null"` LastAuthor *User `orm:"rel(fk);null"` Topic *Topic `orm:"rel(fk)"` Lang int `orm:"index"` IsBest bool `orm:"index"` IsTop bool `orm:"index"` Category *Category `orm:"rel(fk)"` Created time.Time `orm:"auto_now_add"` Updated time.Time `orm:"auto_now;index"` }
post content
func (*Post) Appends ¶
func (m *Post) Appends() orm.QuerySeter
func (*Post) Comments ¶
func (m *Post) Comments() orm.QuerySeter
func (*Post) GetContentCache ¶
type Setting ¶
type Setting struct { Id int Name string `orm:"unique"` Value string `orm:"type(text)"` Updated string `orm:"auto_now"` }
global settings name -> value
type SliceStringField ¶
type SliceStringField []string
A true/false field.
func (*SliceStringField) Add ¶
func (e *SliceStringField) Add(v string)
func (*SliceStringField) Clean ¶
func (e *SliceStringField) Clean() error
func (*SliceStringField) FieldType ¶
func (e *SliceStringField) FieldType() int
func (*SliceStringField) RawValue ¶
func (e *SliceStringField) RawValue() interface{}
func (*SliceStringField) Set ¶
func (e *SliceStringField) Set(d []string)
func (*SliceStringField) SetRaw ¶
func (e *SliceStringField) SetRaw(value interface{}) error
func (*SliceStringField) String ¶
func (e *SliceStringField) String() string
func (SliceStringField) Value ¶
func (e SliceStringField) Value() []string
type Topic ¶
type Topic struct { Id int Name string `orm:"size(30);unique"` Intro string `orm:"type(text)"` NameZhCn string `orm:"size(30);unique"` IntroZhCn string `orm:"type(text)"` Image *Image `orm:"rel(one);null"` ImgUrl string `orm:"size(300)"` Slug string `orm:"size(100);unique"` Followers int `orm:"index"` Order int `orm:"index"` Created time.Time `orm:"auto_now_add"` Updated time.Time `orm:"auto_now;index"` }
post topic
func (*Topic) RefreshFollowers ¶
type User ¶
type User struct { Id int UserName string `orm:"size(30);unique"` NickName string `orm:"size(30)"` Password string `orm:"size(128)"` Url string `orm:"size(100)"` Company string `orm:"size(30)"` Location string `orm:"size(30)"` Email string `orm:"size(80);unique"` GrEmail string `orm:"size(32)"` Info string `` Github string `orm:"size(30)"` Twitter string `orm:"size(30)"` Google string `orm:"size(30)"` Weibo string `orm:"size(30)"` Linkedin string `orm:"size(30)"` Facebook string `orm:"size(30)"` PublicEmail bool `` Followers int `` Following int `` FavTopics int `` Coins int `` IsAdmin bool `orm:"index"` IsActive bool `orm:"index"` IsForbid bool `orm:"index"` Lang int `orm:"index"` LangAdds SliceStringField `orm:"size(50)"` Rands string `orm:"size(10)"` Created time.Time `orm:"auto_now_add"` Updated time.Time `orm:"auto_now"` }
main user table IsAdmin: user is admininstator IsActive: set active when email is verified IsForbid: forbid user login
func (*User) AvatarLink ¶
func (*User) FollowerUsers ¶
func (m *User) FollowerUsers() orm.QuerySeter
func (*User) FollowingUsers ¶
func (m *User) FollowingUsers() orm.QuerySeter
func (*User) RecentComments ¶
func (m *User) RecentComments() orm.QuerySeter
func (*User) RecentPosts ¶
func (m *User) RecentPosts() orm.QuerySeter
func (*User) RefreshFavTopics ¶
Click to show internal directories.
Click to hide internal directories.