Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CreateURLDTO ¶
type CreateURLDTO struct {
LongURL string `json:"long_url"`
}
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(service ports.ShortenerService, log *logger.Logger) *Handler
func (*Handler) Create ¶
func (h *Handler) Create(w http.ResponseWriter, r *http.Request)
Create handler validate request, create new short url and respond it
type ResponseCreateDTO ¶
type ResponseCreateDTO struct {
ShortURL string `json:"short_url"`
}
type ResponseMessage ¶
type ResponseMessage struct {
Message string `json:"message"`
}
func NewResponse ¶
func NewResponse(message string) ResponseMessage
Click to show internal directories.
Click to hide internal directories.