api

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

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

Go to latest
Published: Dec 1, 2021 License: Apache-2.0 Imports: 17 Imported by: 39

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCSRF

func CheckCSRF(apiContext *types.APIContext) 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
	Schemas                     *types.Schemas
	QueryFilter                 types.QueryFilter
	StoreWrapper                StoreWrapper
	URLParser                   parse.URLParser
	Defaults                    Defaults
	AccessControl               types.AccessControl
	// contains filtered or unexported fields
}

func NewAPIServer

func NewAPIServer() *Server

func (*Server) AddSchemas

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

func (*Server) CustomAPIUIResponseWriter

func (s *Server) CustomAPIUIResponseWriter(cssURL, jsURL, version writer.StringGetter)

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