handler

package
v0.0.0-...-3d8e725 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(s service.Service) http.Handler

Types

type Handler

type Handler struct {
	*service.Service
	*zerolog.Logger
}

func (*Handler) Redirect

func (h *Handler) Redirect(w http.ResponseWriter, r *http.Request)

func (Handler) ServeHTTP

func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Handler) Short

func (h *Handler) Short(w http.ResponseWriter, r *http.Request)

Short returns JSON with a short. Asking for a URL in the body.

func (*Handler) URL

func (h *Handler) URL(w http.ResponseWriter, r *http.Request)

URL returns JSON with a full URL. Asking for a Short in the body.

Jump to

Keyboard shortcuts

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