Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetUserInfo ¶
GetUserInfo returns user from request context
func MustGetUserInfo ¶
MustGetUserInfo fails if can't extract user data from the request. should be called from authed controllers only
func SendErrorJSON ¶
SendErrorJSON makes {error: blah, details: blah} json body and responds with error code
Types ¶
type Node ¶
type Node struct { Comment store.Comment `json:"comment"` Replies []*Node `json:"replies,omitempty"` // contains filtered or unexported fields }
Node is a comment with optional replies
type Tree ¶
Tree is formatter making tree from the list of comments
func MakeTree ¶
MakeTree gets unsorted list of comments and produces Tree It will make store.PostInfo by itself and will mark Info.ReadOnly based on passed readOnlyAge Tree maker is local and has no access to the data store. By this reason it has to make Info and won't be able to handle store's read-only status. This status should be set by caller.