handler

package
v0.0.0-...-4ec28c1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMiddleware

func AuthMiddleware(next http.Handler) http.Handler

Types

type Item

type Item struct {
	ID         uuid.UUID `json:"id"`
	ShortUrl   string    `json:"shortUrl"`
	LongUrl    string    `json:"longUrl"`
	Count      int       `json:"count"`
	Permission int       `json:"perms"`
}

type Router

type Router struct {
	chi.Router
	// contains filtered or unexported fields
}

func NewRouter

func NewRouter(us *item.Items) *Router

func (*Router) DeleteDeleteId

func (rt *Router) DeleteDeleteId(w http.ResponseWriter, r *http.Request, suid string)

func (*Router) FindItems

func (rt *Router) FindItems(w http.ResponseWriter, r *http.Request, q string)

/search?q=...

func (*Router) GetReadId

func (rt *Router) GetReadId(w http.ResponseWriter, r *http.Request, suid string)

read/{uid}

func (*Router) PostCreate

func (rt *Router) PostCreate(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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