Documentation ¶
Index ¶
- Constants
- Variables
- func BlogAddInsertCallback(cb func(obj EzOrmObj))
- func BlogAddUpdateCallback(cb func(obj EzOrmObj))
- func BlogInsertCallback(o *Blog)
- func BlogUpdateCallback(o *Blog)
- func Col(col string) (*mgo.Session, *mgo.Collection)
- func DbName() string
- func EnsureIndex()
- func Get_BlogMgr() *_BlogMgr
- func Get_CategoryMgr() *_CategoryMgr
- func Get_TimeRangeMgr() *_TimeRangeMgr
- func MgoSetup(config *db.MongoConfig)
- type Blog
- type Category
- type TimeRange
Constants ¶
View Source
const ( BlogMgoFieldID = "_id" BlogMgoFieldTitle = "title" BlogMgoFieldHits = "Hits" BlogMgoFieldSlug = "Slug" BlogMgoFieldBody = "Body" BlogMgoFieldCreateDate = "createDate" BlogMgoFieldUser = "User" BlogMgoFieldIsPublished = "IsPublished" )
View Source
const ( BlogMgoSortFieldIDAsc = "_id" BlogMgoSortFieldIDDesc = "-_id" BlogMgoSortFieldCreateDateAsc = "createDate" BlogMgoSortFieldCreateDateDesc = "-createDate" )
View Source
const ( TimeRangeMgoFieldFrom = "From" TimeRangeMgoFieldTo = "To" )
Variables ¶
View Source
var BlogMgr *_BlogMgr
View Source
var CategoryMgr *_CategoryMgr
View Source
var ErrOperaBeforeInit = errors.New("please set db.SetOnFinishInit when needed operating db in init()")
View Source
var TimeRangeMgr *_TimeRangeMgr
Functions ¶
func BlogAddInsertCallback ¶
func BlogAddInsertCallback(cb func(obj EzOrmObj))
func BlogAddUpdateCallback ¶
func BlogAddUpdateCallback(cb func(obj EzOrmObj))
func BlogInsertCallback ¶
func BlogInsertCallback(o *Blog)
func BlogUpdateCallback ¶
func BlogUpdateCallback(o *Blog)
func EnsureIndex ¶
func EnsureIndex()
func Get_BlogMgr ¶
func Get_BlogMgr() *_BlogMgr
Get_BlogMgr returns the orm manager in case of its name starts with lower letter
func Get_CategoryMgr ¶
func Get_CategoryMgr() *_CategoryMgr
Get_CategoryMgr returns the orm manager in case of its name starts with lower letter
func Get_TimeRangeMgr ¶
func Get_TimeRangeMgr() *_TimeRangeMgr
Get_TimeRangeMgr returns the orm manager in case of its name starts with lower letter
func MgoSetup ¶
func MgoSetup(config *db.MongoConfig)
Types ¶
type Blog ¶
type Blog struct { ID bson.ObjectId `json:"id" bson:"_id,omitempty"` // the title of blog Title string `bson:"title" json:"title"` // 提示 Hits int32 `bson:"Hits" json:"Hits"` Slug string `bson:"Slug" json:"Slug"` Body string `bson:"Body" json:"Body"` CreateDate time.Time `bson:"createDate" json:"createDate"` User int32 `bson:"User" json:"User"` IsPublished bool `bson:"IsPublished" json:"IsPublished"` // contains filtered or unexported fields }
Blog blog
func (*Blog) GetClassName ¶
func (*Blog) GetNameSpace ¶
func (*Blog) InsertUnique ¶
func (*Blog) IsSearchEnabled ¶
Click to show internal directories.
Click to hide internal directories.