resource

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DispatcherEnv = "X-Dispatcher-Env"

Variables

This section is empty.

Functions

func FormValue

func FormValue(r *http.Request, key string) (string, error)

func FormValueBool

func FormValueBool(r *http.Request, key string) (bool, error)

func FormValueFloat32

func FormValueFloat32(r *http.Request, key string) (float32, error)

func FormValueInt16

func FormValueInt16(r *http.Request, key string, base int) (int16, error)

func FormValueInt32

func FormValueInt32(r *http.Request, key string, base int) (int32, error)

Types

type Deleter

type Deleter interface {
	Delete(w http.ResponseWriter, r *http.Request)
}

DELETE {resource}

type Environment

type Environment map[string]string

environment table

func GetEnvironment

func GetEnvironment(r *http.Request) (Environment, *http.Request)

func (Environment) Get

func (env Environment) Get(key string) string

func (Environment) GetInt

func (env Environment) GetInt(key string, base int) (int, error)

func (Environment) GetInt64

func (env Environment) GetInt64(key string, base int) (int64, error)

func (Environment) Set

func (env Environment) Set(key, value string)

func (Environment) SetInt

func (env Environment) SetInt(key string, value int)

type Getter

type Getter interface {
	Get(w http.ResponseWriter, r *http.Request)
}

GET {resource}

type Handler

type Handler interface {
	http.Handler
}

type Poster

type Poster interface {
	Post(w http.ResponseWriter, r *http.Request)
}

POST {resource}

type Putter

type Putter interface {
	Put(w http.ResponseWriter, r *http.Request)
}

PUT {resource}

type Resource

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

func (*Resource) Allowed

func (o *Resource) Allowed(r *http.Request, method string) bool

func (*Resource) BadRequest

func (_ *Resource) BadRequest(w http.ResponseWriter, s string, args ...interface{})

func (Resource) BestMime

func (_ Resource) BestMime(r *http.Request, supported ...string) (string, error)

func (*Resource) EnvValue

func (_ *Resource) EnvValue(r *http.Request, key string) string

func (*Resource) EnvValueInt

func (_ *Resource) EnvValueInt(r *http.Request, key string) (int, error)

func (*Resource) Environment

func (_ *Resource) Environment(r *http.Request) (map[string]string, *http.Request)

static convenience methods

func (*Resource) FormValue

func (o *Resource) FormValue(r *http.Request, key string) (string, error)

func (*Resource) FormValueBool

func (o *Resource) FormValueBool(r *http.Request, key string) (bool, error)

func (*Resource) FormValueFloat32

func (o *Resource) FormValueFloat32(r *http.Request, key string) (float32, error)

func (*Resource) FormValueInt32

func (o *Resource) FormValueInt32(r *http.Request, key string, base int) (int32, error)

func (*Resource) Handle

func (o *Resource) Handle(path string, h http.Handler)

func (*Resource) HandleFunc

func (o *Resource) HandleFunc(path string, f http.HandlerFunc)

func (*Resource) NotAllowed

func (o *Resource) NotAllowed(w http.ResponseWriter, r *http.Request, allow string)

func (*Resource) NotFound

func (o *Resource) NotFound(w http.ResponseWriter, r *http.Request)

func (*Resource) ParseForm

func (_ *Resource) ParseForm(r *http.Request) error

and as static methods

func (*Resource) RaiseNotFound

func (o *Resource) RaiseNotFound(w http.ResponseWriter, _ *http.Request)

Errors

func (*Resource) ServeHTTP

func (o *Resource) ServeHTTP(p Handler, w http.ResponseWriter, r *http.Request)

http.Handler

func (*Resource) SetFallback

func (o *Resource) SetFallback(h http.HandlerFunc)

func (*Resource) WriteJSON

func (o *Resource) WriteJSON(w http.ResponseWriter, prefix string, indent string, d interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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