handler

package
v0.0.0-...-36feab7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreatePostHandler

type CreatePostHandler struct {
	core.Handler
	// contains filtered or unexported fields
}

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

type FeedHandler struct {
	core.Handler
	// contains filtered or unexported fields
}

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

type GetPostHandler struct {
	core.Handler
	// contains filtered or unexported fields
}

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

type LikePostHandler struct {
	core.Handler
	// contains filtered or unexported fields
}

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

type ProfileFeedHandler struct {
	core.Handler
	// contains filtered or unexported fields
}

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

type UnlikePostHandler struct {
	core.Handler
	// contains filtered or unexported fields
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL