rest

package module
v0.0.0-...-5a31d18 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2013 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package rest implements the REST model for Representational State Transfer.

Index

Constants

View Source
const (
	ApplicationJSON = "application/json;charset=utf-8"
	PlainText       = "text/plain;charset=utf-8"
)

Standard Content-Type values

Variables

This section is empty.

Functions

func Handle

func Handle(path string, obj *Object)

Types

type Object

type Object struct {
	ESource *esource.EventSource
	// contains filtered or unexported fields
}

func NewObject

func NewObject(obj interface{}) *Object

func (*Object) Delete

func (obj *Object) Delete(w io.Writer, headers http.Header, r *http.Request) (int, error)

func (*Object) Get

func (obj *Object) Get(w io.Writer, headers http.Header, r *http.Request) (int, error)

func (*Object) Head

func (obj *Object) Head(w io.Writer, headers http.Header, r *http.Request) (int, error)

func (*Object) Patch

func (obj *Object) Patch(w io.Writer, headers http.Header, r *http.Request) (int, error)

func (*Object) Post

func (obj *Object) Post(w io.Writer, headers http.Header, r *http.Request) (int, error)

func (*Object) Put

func (obj *Object) Put(w io.Writer, headers http.Header, r *http.Request) (int, error)

func (*Object) ServeHTTP

func (obj *Object) 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