Documentation ¶
Index ¶
- Constants
- func AddChangeLog(item ChangeLog)
- func AlreadyLikes(liker string, postID bson.ObjectId) bool
- func ChangeLogExist(postID bson.ObjectId, unix int64) bool
- func CodeInUseWorkshop(code string) bool
- func DeleteComments(id bson.ObjectId)
- func DeleteLike(liker string, postID bson.ObjectId)
- func DeleteWorkshop(id bson.ObjectId)
- func UpdateChangeLog(content string, postID bson.ObjectId, unix int64)
- func WorkshopCountLikes(id bson.ObjectId) int
- func WorkshopCreatorCount(creator string) int
- type ChangeLog
- type Comment
- type Like
- type User
- type Workshop
Constants ¶
View Source
const (
WorkshopLimit = 24
)
Variables ¶
This section is empty.
Functions ¶
func AddChangeLog ¶
func AddChangeLog(item ChangeLog)
func CodeInUseWorkshop ¶
func DeleteComments ¶
func DeleteLike ¶
func DeleteWorkshop ¶
func WorkshopCountLikes ¶
func WorkshopCreatorCount ¶
Types ¶
type ChangeLog ¶
type ChangeLog struct { ID bson.ObjectId `bson:"_id,omitempty" json:"-"` PostID bson.ObjectId `bson:"_post"` Content string `bson:"content"` Code string `bson:"code"` Version string `bson:"version"` Posted time.Time `bson:"posted"` Unix int64 `bson:"unix"` }
func LatestChangeLog ¶
type Comment ¶
type Like ¶
type User ¶
type User struct { ID bson.ObjectId `bson:"_id,omitempty" json:"-"` NickName string `bson:"nick"` BattleID string `bson:"bid"` URL string `bson:"url" form:"url"` ShortID string `bson:"short_id"` Name string `bson:"name" form:"name"` NameLower string `bson:"name_lower"` Image string `bson:"image" form:"-"` ImagePath string `bson:"image_path" form:"-"` // NoBSON Mode string `bson:"-" form:"mode"` Type string `bson:"-" form:"type"` Code string `bson:"-" form:"code"` // Never used }
func BulkFindUser ¶
func UpdateUser ¶
func UpsertUser ¶
func (User) GetNickNameNoTag ¶
type Workshop ¶
type Workshop struct { ID bson.ObjectId `bson:"_id,omitempty" json:"-"` ShortID string `bson:"short_id" json:"-"` Code string `bson:"code" form:"code"` Title string `bson:"title" form:"title"` TLDR string `bson:"tldr" form:"tldr"` Description string `bson:"desc" form:"desc"` Snippet string `bson:"snippet" form:"snippet"` Privacy int `bson:"privacy" form:"privacy"` Version string `bson:"version" form:"version"` Image string `bson:"image" form:"-"` ImagePath string `bson:"image_path" form:"-"` Mode string `bson:"-" form:"mode"` PostID string `bson:"-" form:"post_id"` ChangeLog string `bson:"-" form:"change_log"` Author string `bson:"author" form:"-"` Views int64 `bson:"views" form:"-"` Score float64 `bson:"score"` Posted time.Time `bson:"posted" form:"-"` Unix int64 `bson:"unix" form:"-"` Updated time.Time `bson:"updated" form:"-"` UpdatedUnix int64 `bson:"updated_unix" form:"-"` // NoBSON Type string `bson:"-" form:"type"` }
func AddWorkshop ¶
func ImportWorkshop ¶
func RandomWorkshop ¶
func RandomWorkshop() Workshop
func SearchWorkShop ¶
func SingleWorkshop ¶
func UpdateWorkshop ¶
func (Workshop) UpdateViews ¶
func (w Workshop) UpdateViews()
Click to show internal directories.
Click to hide internal directories.