handlers

package
v0.0.0-...-07e9266 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

type RedirectUrlRequest

type RedirectUrlRequest struct {
	ShortUrl string `json:"short_url"`
}

type ShortenUrlRequest

type ShortenUrlRequest struct {
	Url string `json:"url"`
}

type ShortenUrlResponse

type ShortenUrlResponse struct {
	ShortUrl string `json:"short_url"`
}

type UrlHandler

type UrlHandler struct {
	RedisClient *redis.Client
}

func (*UrlHandler) DeleteUrl

func (h *UrlHandler) DeleteUrl(w http.ResponseWriter, r *http.Request)

func (*UrlHandler) RedirectUrl

func (h *UrlHandler) RedirectUrl(w http.ResponseWriter, r *http.Request)

func (*UrlHandler) ShortenUrl

func (h *UrlHandler) ShortenUrl(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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