rest: kylelemons.net/go/rest Index | Files

package rest

import "kylelemons.net/go/rest"

Package rest implements the REST model for Representational State Transfer.

Index

Package Files

rest.go

Constants

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

Standard Content-Type values

func Handle Uses

func Handle(path string, obj *Object)

type Object Uses

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

func NewObject Uses

func NewObject(obj interface{}) *Object

func (*Object) Delete Uses

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

func (*Object) Get Uses

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

func (*Object) Head Uses

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

func (*Object) Patch Uses

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

func (*Object) Post Uses

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

func (*Object) Put Uses

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

func (*Object) ServeHTTP Uses

func (obj *Object) ServeHTTP(w http.ResponseWriter, r *http.Request)

Package rest imports 12 packages (graph). Updated 2017-02-10. Refresh now. Tools for package owners.