Documentation
¶
Index ¶
- Variables
- func Delete(deps Deps, c Comment) error
- func DeletePostComments(deps Deps, postID bson.ObjectId) error
- func FetchCount(d Deps, query common.Query) (c int, err error)
- func Post(id bson.ObjectId, limit, offset int, reverse bool, before *bson.ObjectId, ...) common.Query
- func User(id bson.ObjectId, limit, offset int) common.Query
- type Comment
- func (c Comment) GetContent() string
- func (c Comment) GetParseableMeta() map[string]interface{}
- func (c Comment) RelatedID() bson.ObjectId
- func (c Comment) RelatedPost() bson.ObjectId
- func (c Comment) UpdateContent(content string) content.Parseable
- func (c Comment) VotableID() bson.ObjectId
- func (c Comment) VotableType() string
- type Comments
- func (all Comments) IDList() []bson.ObjectId
- func (all Comments) Map() map[bson.ObjectId]Comment
- func (all Comments) NestedIDList() (list []bson.ObjectId)
- func (all Comments) PostIDs() []bson.ObjectId
- func (all Comments) PostsScope() common.Scope
- func (all Comments) StrMap() map[string]Comment
- func (all Comments) UsersScope() common.Scope
- func (all Comments) VotesOf(deps Deps, userID bson.ObjectId) (list votes.List, err error)
- func (all Comments) WithReplies(deps Deps, max int) (Comments, error)
- func (all Comments) WithUsers(deps Deps) (Comments, error)
- type CommentsSet
- type Deps
- type Replies
- type RepliesList
Constants ¶
This section is empty.
Variables ¶
View Source
var CommentNotFound = errors.New("Comment has not been found by given criteria.")
Functions ¶
Types ¶
type Comment ¶
type Comment struct { Id bson.ObjectId `bson:"_id,omitempty" json:"id,omitempty"` UserId bson.ObjectId `bson:"user_id" json:"user_id"` PostId bson.ObjectId `bson:"post_id,omitempty" json:"post_id,omitempty"` Votes votes.Votes `bson:"votes" json:"votes"` User interface{} `bson:"-" json:"author,omitempty"` Position int `bson:"position" json:"-"` Liked int `bson:"-" json:"liked,omitempty"` Content string `bson:"content" json:"content"` ReplyTo bson.ObjectId `bson:"reply_to,omitempty" json:"reply_to,omitempty"` ReplyType string `bson:"reply_type,omitempty" json:"reply_type,omitempty"` Chosen bool `bson:"chosen,omitempty" json:"chosen,omitempty"` Created time.Time `bson:"created_at" json:"created_at"` Updated time.Time `bson:"updated_at" json:"updated_at"` Deleted *time.Time `bson:"deleted_at,omitempty" json:"-"` // Runtime generated fields. Replies interface{} `bson:"-" json:"replies,omitempty"` }
func UpsertComment ¶
UpsertComment performs validations before upserting data struct
func (Comment) GetContent ¶
func (Comment) GetParseableMeta ¶
func (Comment) RelatedPost ¶
func (Comment) VotableType ¶
type Comments ¶
type Comments []Comment
func (Comments) NestedIDList ¶
func (Comments) PostsScope ¶
func (Comments) UsersScope ¶
type CommentsSet ¶
type Replies ¶
type RepliesList ¶
type RepliesList []Replies
Click to show internal directories.
Click to hide internal directories.