operator

package module
v0.0.0-...-579e265 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2014 License: MIT Imports: 10 Imported by: 0

README

yolo

Lightweight router and parameter injector for writing http services

It will eventually be stable and useful (working sporadically currently).

Build Status

GoDoc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParamsFrom

func ParamsFrom(req *http.Request) map[string]string

Types

type Handler

type Handler interface{}

type Operator

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

func NewOperator

func NewOperator() *Operator

NewOperator returns a new conductor for your web application.

func (*Operator) Delete

func (c *Operator) Delete(url string, handlers ...Handler)

Delete registers a set of handlers for any HTTP DELETE request to the specified url.

func (*Operator) Get

func (c *Operator) Get(url string, handlers ...Handler)

Get registers a set of handlers for any HTTP GET request to the specified url.

func (*Operator) Head

func (c *Operator) Head(url string, handlers ...Handler)

Head registers a set of handlers for any HTTP HEAD request to the specified url.

func (*Operator) Options

func (c *Operator) Options(url string, handlers ...Handler)

Options registers a set of handlers for any HTTP OPTIONS request to the specified url.

func (*Operator) ParseBody

func (c *Operator) ParseBody() *Operator

ParseBody tells the operator to always parse the body of HTTP requests if a Body exists.

func (*Operator) Post

func (c *Operator) Post(url string, handlers ...Handler)

Post registers a set of handlers for any HTTP POST request to the specified url.

func (*Operator) Put

func (c *Operator) Put(url string, handlers ...Handler)

Put registers a set of handlers for any HTTP Put request to the specified url.

func (*Operator) ServeHTTP

func (c *Operator) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP allows you to attach this operator to the stdlib Go HTTP Server, it can also be used as the entry any exit point for any http.Request/http.ResponseWrite pair.

func (*Operator) Trace

func (c *Operator) Trace(url string, handlers ...Handler)

Trace registers a set of handlers for any HTTP TRACE request to the specified url.

Jump to

Keyboard shortcuts

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