api

package
Version: v0.0.0-...-cad01ba Latest Latest
Warning

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

Go to latest
Published: Nov 13, 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
	ResponseWriters map[string]ResponseWriter

	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)

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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