Documentation ¶
Index ¶
- Variables
- func CanReplyTo(commentID, postID int64, u *session.Session, commentCache ...*Comment) error
- func CanView(commentID int64, u *session.Session, commentCache ...*Comment) error
- func ContentValid(content string) error
- func Delete(commentID int64) error
- func GetPostID(commentID int64) (int64, error)
- func GetPostTopLevel(postID int64) (total int64, err error)
- func GetPostTotal(postID int64, depth ...int64) (total int64, err error)
- func GetRepliesTotal(commentID int64, depth ...int64) (total int64, err error)
- func GetUserId(commentID int64) (int64, error)
- func UpdateContent(commentID int64, content string) error
- type Comment
- func (c *Comment) CountReplies() (err error)
- func (z *Comment) DecodeMsg(dc *msgp.Reader) (err error)
- func (z *Comment) EncodeMsg(en *msgp.Writer) (err error)
- func (c *Comment) Insert() (err error)
- func (z *Comment) MarshalMsg(b []byte) (o []byte, err error)
- func (z *Comment) Msgsize() (s int)
- func (z *Comment) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (c *Comment) Validate() error
- type CommentList
- type List
- type ListComments
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrContentLength max 4096 ErrContentLength = errtools.InvalidLen(2, 4096) )
View Source
var ErrNoComment = errors.New("post/comment: Error No Comment Found OR Insufficient permission to view this Comment")
Functions ¶
func CanReplyTo ¶
func GetPostTopLevel ¶
GetPostTopLevel Get total top level (not a reply) comments for a post
func GetPostTotal ¶
GetTotal comments for post
func GetRepliesTotal ¶
GetRepliesTotal
func UpdateContent ¶
Types ¶
type Comment ¶
type Comment struct { ID int64 `msg:"id" json:"id"` UserID int64 `msg:"userId" json:"userId"` PostID int64 `msg:"postId" json:"postId"` // ParentID comment id ParentID int64 `msg:"parentId" json:"parentId"` Created int64 `msg:"created" json:"created"` Updated int64 `msg:"updated" json:"updated"` Content string `msg:"content" json:"content"` Replies int64 `msg:"replies" json:"replies"` Depth int64 `msg:"depth" json:"depth"` Children map[int64]*Comment `msg:"children" json:"children"` }
func GetPostUserID ¶
func (*Comment) CountReplies ¶
func (*Comment) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (*Comment) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*Comment) UnmarshalMsg ¶
UnmarshalMsg implements msgp.Unmarshaler
type CommentList ¶
type List ¶
type List struct { ListComments Order map[int64]int64 `msg:"order" json:"order"` }
func (*List) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type ListComments ¶
func (*ListComments) DecodeMsg ¶
func (z *ListComments) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (ListComments) EncodeMsg ¶
func (z ListComments) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (ListComments) MarshalMsg ¶
func (z ListComments) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (ListComments) Msgsize ¶
func (z ListComments) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*ListComments) UnmarshalMsg ¶
func (z *ListComments) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
Click to show internal directories.
Click to hide internal directories.