Documentation ¶
Overview ¶
Package distributed is for building federated communities
Index ¶
- func Comments(w http.ResponseWriter, req *http.Request)
- func Cors(w http.ResponseWriter, req *http.Request) bool
- func Login(w http.ResponseWriter, req *http.Request)
- func NewComment(w http.ResponseWriter, req *http.Request)
- func NewPost(w http.ResponseWriter, req *http.Request)
- func Posts(w http.ResponseWriter, req *http.Request)
- func ReadSession(w http.ResponseWriter, req *http.Request)
- func Run(address string)
- func VoteWrapper(upvote bool, isComment bool) func(w http.ResponseWriter, req *http.Request)
- type Comment
- type CommentRequest
- type CommentsRequest
- type LoginRequest
- type Post
- type PostRequest
- type PostsRequest
- type VoteRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewComment ¶
func NewComment(w http.ResponseWriter, req *http.Request)
func ReadSession ¶
func ReadSession(w http.ResponseWriter, req *http.Request)
func VoteWrapper ¶
Types ¶
type CommentRequest ¶
type CommentsRequest ¶
type CommentsRequest struct {
PostId string `json:"postId"`
}
type LoginRequest ¶
type Post ¶
type Post struct { Id string `json:"id"` UserId string `json:"userId"` UserName string `json:"userName"` Content string `json:"content"` Created string `json:"created"` Upvotes float32 `json:"upvotes"` Downvotes float32 `json:"downvotes"` Score float32 `json:"score"` Title string `json:"title"` Url string `json:"url"` Sub string `json:"sub"` CommentCount float32 `json:"commentCount"` }
type PostRequest ¶
type PostsRequest ¶
type VoteRequest ¶
Click to show internal directories.
Click to hide internal directories.