resource

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Code generated DO NOT EDIT

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultResourceChecker

func DefaultResourceChecker(ctx context.Context) (context.Context, error)

check request is a exact match (leaf, not intermediate router) and makes sure there is no trailing slash

Types

type Checker

type Checker interface {
	Check(ctx context.Context) (context.Context, error)
}

type ContextChecker

type ContextChecker func(ctx context.Context) (context.Context, error)

type Getter

type Getter interface {
	Get(rw http.ResponseWriter, req *http.Request) error
}

GET

type Optioner

type Optioner interface {
	Options(rw http.ResponseWriter, req *http.Request) error
}

OPTIONS

type Peeker

type Peeker interface {
	Head(rw http.ResponseWriter, req *http.Request) error
}

HEAD

type Poster

type Poster interface {
	Post(rw http.ResponseWriter, req *http.Request) error
}

POST

type Resource

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

func NewResource

func NewResource(v interface{}, eh web.ErrorHandlerFunc, check ContextChecker) *Resource

func (Resource) BestMime

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

func (Resource) FormValue

func (_ Resource) FormValue(req *http.Request, key string) (string, error)

func (Resource) FormValueBool

func (_ Resource) FormValueBool(req *http.Request, key string) (bool, error)

func (Resource) FormValueFloat32

func (_ Resource) FormValueFloat32(req *http.Request, key string) (float32, error)

func (Resource) FormValueInt16

func (_ Resource) FormValueInt16(req *http.Request, key string) (int16, error)

func (Resource) FormValueInt32

func (_ Resource) FormValueInt32(req *http.Request, key string) (int32, error)

func (*Resource) Init

func (m *Resource) Init(v interface{}, eh web.ErrorHandlerFunc, check ContextChecker)

func (Resource) ParseForm

func (_ Resource) ParseForm(req *http.Request, size int64) error

func (*Resource) ServeHTTP

func (m *Resource) ServeHTTP(rw http.ResponseWriter, req *http.Request)

func (*Resource) TryServeHTTP

func (m *Resource) TryServeHTTP(rw http.ResponseWriter, req *http.Request) error

func (Resource) WriteJSON

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

Jump to

Keyboard shortcuts

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