Documentation
¶
Index ¶
- Constants
- Variables
- func NewFormatEventSubscriber(formatResolver FormatResolver) event.Subscriber
- type Context
- type ContextFactory
- type FormatResolver
- type Operation
- type OperationHandler
- type OperationType
- type PostProcessingUriFactory
- type QueryParameters
- type RequestContextEvent
- type RequestEvent
- type ResponseEvent
- type RouteParameters
- type SecurityChecker
Constants ¶
View Source
const (
ContextParamName = "_api_context"
)
View Source
const RequestContextEventName = "api.request.context"
Variables ¶
View Source
var ( GetCollectionOperation = OperationType{/* contains filtered or unexported fields */} GetOperation = OperationType{/* contains filtered or unexported fields */} PostOperation = OperationType{/* contains filtered or unexported fields */} PutOperation = OperationType{/* contains filtered or unexported fields */} PatchOperation = OperationType{/* contains filtered or unexported fields */} DeleteOperation = OperationType{/* contains filtered or unexported fields */} )
Functions ¶
func NewFormatEventSubscriber ¶
func NewFormatEventSubscriber(formatResolver FormatResolver) event.Subscriber
Types ¶
type Context ¶
type Context struct {
Operation *Operation
RouteParameters RouteParameters
QueryParameters QueryParameters
Format string
Data any
Headers http.Header
StatusCode int
}
type ContextFactory ¶
func NewContextFactory ¶
func NewContextFactory() ContextFactory
type FormatResolver ¶
func NewFormatResolver ¶
func NewFormatResolver(mimeTypeProvider mime.MimeTypeProvider) FormatResolver
type Operation ¶
type Operation struct {
Name string
ResourceName string
Type OperationType
UriTemplate string
Deserializer serialization.Deserializer
Provider state.Provider
Processor state.Processor
Security SecurityChecker
StatusCode int
}
type OperationHandler ¶
type OperationHandler interface {
Handle(w http.ResponseWriter, r *http.Request, c *Context) error
}
func NewDefaultOperationHandler ¶
func NewDefaultOperationHandler() OperationHandler
func NewPostProcessingHandler ¶
func NewPostProcessingHandler(uriFactory PostProcessingUriFactory) OperationHandler
func NewResponseContentTypeHandler ¶
func NewResponseContentTypeHandler(formatProvider sharedMime.FormatProvider) OperationHandler
func NewResponseHandler ¶
func NewResponseHandler() OperationHandler
type OperationType ¶
type OperationType struct {
// contains filtered or unexported fields
}
func (OperationType) Method ¶
func (ot OperationType) Method() string
type QueryParameters ¶
type QueryParameters = any
type RequestContextEvent ¶
type RequestContextEvent struct {
*event.BasicEvent
ResponseWriter http.ResponseWriter
Request *http.Request
Context *Context
}
func NewRequestContextEvent ¶
func NewRequestContextEvent(w http.ResponseWriter, r *http.Request, ctx *Context) *RequestContextEvent
type RequestEvent ¶
type RequestEvent struct {
*event.BasicEvent
ResponseWriter http.ResponseWriter
Request *http.Request
Context *Context
}
func NewRequestEvent ¶
func NewRequestEvent(name string, w http.ResponseWriter, r *http.Request, ctx *Context) *RequestEvent
type ResponseEvent ¶
type ResponseEvent struct {
*event.BasicEvent
ResponseWriter http.ResponseWriter
Request *http.Request
Context *Context
}
func NewResponseEvent ¶
func NewResponseEvent(name string, w http.ResponseWriter, r *http.Request, c *Context) *ResponseEvent
type RouteParameters ¶
type SecurityChecker ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.