glug

package
v0.0.0-...-25d0a7b Latest Latest
Warning

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

Go to latest
Published: May 1, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	Writer  http.ResponseWriter
	Request *http.Request
	Params  url.Values
	// contains filtered or unexported fields
}

Conn is a struct to carry all request related data through plugs.

func (Conn) Halt

func (conn Conn) Halt() Conn

Halt will stop execution of plugs.

type Plug

type Plug func(Conn) Conn

Plug is a function type we should use to make a pipeline for request.

type Router

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

Router is a http.Handler.

func New

func New() *Router

New will initialize new router.

func (*Router) HandleFunc

func (router *Router) HandleFunc(method string, path string, plugs ...Plug)

HandleFunc will add new endpoint to router.

func (*Router) ServeHTTP

func (router *Router) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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