Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreatePostHandler ¶
CreatePostHandler is a http.Handler used to handle POSt requests to create post records.
func NewCreatePostHandler ¶
func NewCreatePostHandler(repo repository.PostRepository, users users.Client) *CreatePostHandler
NewCreatePostHandler returns a new instance of CreatePostHandler.
func (*CreatePostHandler) ServeHTTP ¶
func (h *CreatePostHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type CreatePostRequest ¶
type CreatePostRequest struct { UserReferenceID string `json:"userReferenceId"` MediaID *int `json:"mediaId"` Caption string `json:"caption"` }
CreatePostRequest is the body of a request.
type CreatePostResponse ¶
type CreatePostResponse struct {
ReferenceID string `json:"referenceId"`
}
CreatePostResponse is the body of the response.
type FeedHandler ¶
FeedHandler is a http.Handler used to request a user's post feed.
func NewFeedHandler ¶
func NewFeedHandler(repo repository.PostRepository) *FeedHandler
NewFeedHandler returns a new instance of FeedHandler.
func (*FeedHandler) ServeHTTP ¶
func (h *FeedHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GetPostHandler ¶
GetPostHandler is a http.Handler used to get a post for a user.
func NewGetPostHandler ¶
func NewGetPostHandler(provider provider.PostProvider) *GetPostHandler
NewGetPostHandler returns a new instance of GetPostHandler.
func (*GetPostHandler) ServeHTTP ¶
func (h *GetPostHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type LikePostHandler ¶
LikePostHandler is a http.Handler used to mark a post as liked by a user.
func NewLikePostHandler ¶
func NewLikePostHandler(repo repository.PostRepository, likes repository.LikeRepository) *LikePostHandler
NewLikePostHandler returns a new instance of LikePostHandler.
func (*LikePostHandler) ServeHTTP ¶
func (h *LikePostHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type LikePostRequest ¶
type LikePostRequest struct { PostReferenceID string `json:"postReferenceId"` UserReferenceID string `json:"userReferenceId"` }
LikePostRequest is the request body structure.
type ProfileFeedHandler ¶
ProfileFeedHandler is a http.Handler used to request a user's profile feed.
func NewProfileFeedHandler ¶
func NewProfileFeedHandler(provider provider.PostProvider) *ProfileFeedHandler
NewProfileFeedHandler returns a new instance of ProfileFeedHandler.
func (*ProfileFeedHandler) ServeHTTP ¶
func (h *ProfileFeedHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type UnlikePostHandler ¶
UnlikePostHandler is a http.Handler used to mark a post as unliked by a user.
func NewUnlikePostHandler ¶
func NewUnlikePostHandler(repo repository.PostRepository, likes repository.LikeRepository) *UnlikePostHandler
NewUnlikePostHandler returns a new instance of UnlikePostHandler.
func (*UnlikePostHandler) ServeHTTP ¶
func (h *UnlikePostHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type UnlikePostRequest ¶
type UnlikePostRequest struct { PostReferenceID string `json:"postReferenceId"` UserReferenceID string `json:"userReferenceId"` }
UnlikePostRequest is the request body structure.