handler

package
v0.0.0-...-31d6f92 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	RS model.RedisStorage
}

Handler struct should be used as long-living struct by App.

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

CreateShortlink creates and responds the short link

func (*Handler) GetShortlinkInfo

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

GetShortlinkInfo responds the link info

func (*Handler) Redirect

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

Redirect redirects from shortlink to full link

type Response

type Response struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Content interface{} `json:"content"`
}

Response is HTTP response

Jump to

Keyboard shortcuts

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