Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisClient ¶
type URLHandler ¶
type URLHandler struct {
// contains filtered or unexported fields
}
func NewURLHandler ¶
func NewURLHandler(rdb RedisClient) *URLHandler
func (*URLHandler) GenerateShortURL ¶
func (h *URLHandler) GenerateShortURL(w http.ResponseWriter, r *http.Request)
GenerateShortURL creates a short URL and stores it in the handler's map
func (*URLHandler) IncrementAccessCount ¶
func (s *URLHandler) IncrementAccessCount(ctx context.Context, shortURL string) error
func (*URLHandler) RedirectShortURL ¶
func (h *URLHandler) RedirectShortURL(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.