api

package
v0.0.0-...-eef2c6e Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCSRF

func CheckCSRF(rw http.ResponseWriter, req *http.Request) error

func ValidateAction

func ValidateAction(request *types.APIContext) (*types.Action, error)

Types

type Defaults

type Defaults struct {
	ActionHandler types.ActionHandler
	ListHandler   types.RequestHandler
	LinkHandler   types.RequestHandler
	CreateHandler types.RequestHandler
	DeleteHandler types.RequestHandler
	UpdateHandler types.RequestHandler
	Store         types.Store
	ErrorHandler  types.ErrorHandler
}

type Parser

type Parser func(rw http.ResponseWriter, req *http.Request) (*types.APIContext, error)

type ResponseWriter

type ResponseWriter interface {
	Write(apiContext *types.APIContext, code int, obj interface{})
}

type Server

type Server struct {
	IgnoreBuiltin               bool
	Parser                      Parser
	Resolver                    parse.ResolverFunc
	SubContextAttributeProvider types.SubContextAttributeProvider
	ResponseWriters             map[string]ResponseWriter

	QueryFilter  types.QueryFilter
	StoreWrapper StoreWrapper
	URLParser    parse.URLParser
	Defaults     Defaults
	// contains filtered or unexported fields
}

func NewAPIServer

func NewAPIServer() *Server

func (*Server) AddSchemas

func (s *Server) AddSchemas(schemas *types.Schemas) error

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(rw http.ResponseWriter, req *http.Request)

type StoreWrapper

type StoreWrapper func(types.Store) types.Store

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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