Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetupResponse ¶
func SetupResponse(w http.ResponseWriter, contentType string, body []byte, statusCode int)
* Set type of message (json or msgpack)
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func (*Handler) Get ¶
func (h *Handler) Get(w http.ResponseWriter, r *http.Request)
* Get request from user
func (*Handler) Post ¶
func (h *Handler) Post(w http.ResponseWriter, r *http.Request)
* Post request from user
func (*Handler) Serializer ¶
func (h *Handler) Serializer(contentType string) shortener.RedirectSerializer
* Serialize depending of type of message
type RedirectHandler ¶
type RedirectHandler interface { Get(http.ResponseWriter, *http.Request) Post(http.ResponseWriter, *http.Request) }
* HTTP Layer
func NewHandler ¶
func NewHandler(redirectService shortener.RedirectService) RedirectHandler
Click to show internal directories.
Click to hide internal directories.