Documentation ¶
Index ¶
- func JSONMiddleWare(next http.Handler) http.Handler
- func JWTAuth(original func(w http.ResponseWriter, r *http.Request)) func(w http.ResponseWriter, r *http.Request)
- func LoggingMiddleware(next http.Handler) http.Handler
- func TimeOutMiddleware(next http.Handler) http.Handler
- type CommentService
- type CreateCommentDTO
- type Handler
- func (h *Handler) CreateComment(w http.ResponseWriter, r *http.Request)
- func (h *Handler) DeleteComment(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetComment(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetComments(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Serve() error
- func (h *Handler) UpdateComment(w http.ResponseWriter, r *http.Request)
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JWTAuth ¶
func JWTAuth( original func(w http.ResponseWriter, r *http.Request), ) func(w http.ResponseWriter, r *http.Request)
Types ¶
type CommentService ¶
type CommentService interface { GetComments(context.Context) ([]comment.Comment, error) CreateComment(context.Context, comment.Comment) (comment.Comment, error) GetComment(context.Context, string) (comment.Comment, error) UpdateComment(context.Context, string, comment.Comment) (comment.Comment, error) DeleteComment(context.Context, string) error }
type CreateCommentDTO ¶
type Handler ¶
type Handler struct { Router *mux.Router Service CommentService Server http.Server }
func NewHandler ¶
func NewHandler(service CommentService) *Handler
func (*Handler) CreateComment ¶
func (h *Handler) CreateComment(w http.ResponseWriter, r *http.Request)
func (*Handler) DeleteComment ¶
func (h *Handler) DeleteComment(w http.ResponseWriter, r *http.Request)
func (*Handler) GetComment ¶
func (h *Handler) GetComment(w http.ResponseWriter, r *http.Request)
func (*Handler) GetComments ¶
func (h *Handler) GetComments(w http.ResponseWriter, r *http.Request)
func (*Handler) UpdateComment ¶
func (h *Handler) UpdateComment(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.