Documentation ¶
Overview ¶
Package corsadaptor implements a filter that adapts CORS stuff.
Index ¶
- Constants
- type CORSAdaptor
- func (a *CORSAdaptor) Close()
- func (a *CORSAdaptor) Handle(ctx *context.Context) string
- func (a *CORSAdaptor) Inherit(_ filters.Filter)
- func (a *CORSAdaptor) Init()
- func (a *CORSAdaptor) Kind() *filters.Kind
- func (a *CORSAdaptor) Name() string
- func (a *CORSAdaptor) Spec() filters.Spec
- func (a *CORSAdaptor) Status() interface{}
- type Spec
Constants ¶
View Source
const (
// Kind is kind of CORSAdaptor.
Kind = "CORSAdaptor"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CORSAdaptor ¶
type CORSAdaptor struct {
// contains filtered or unexported fields
}
CORSAdaptor is filter for CORS request.
func (*CORSAdaptor) Handle ¶
func (a *CORSAdaptor) Handle(ctx *context.Context) string
Handle handles cross-origin requests.
func (*CORSAdaptor) Inherit ¶
func (a *CORSAdaptor) Inherit(_ filters.Filter)
Inherit inherits previous generation of CORSAdaptor.
func (*CORSAdaptor) Kind ¶
func (a *CORSAdaptor) Kind() *filters.Kind
Kind returns the kind of CORSAdaptor.
func (*CORSAdaptor) Name ¶
func (a *CORSAdaptor) Name() string
Name returns the name of the CORSAdaptor filter instance.
func (*CORSAdaptor) Spec ¶
func (a *CORSAdaptor) Spec() filters.Spec
Spec returns the spec used by the CORSAdaptor
type Spec ¶
type Spec struct { filters.BaseSpec `json:",inline"` AllowedOrigins []string `json:"allowedOrigins,omitempty"` AllowedMethods []string `json:"allowedMethods,omitempty" jsonschema:"uniqueItems=true,format=httpmethod-array"` AllowedHeaders []string `json:"allowedHeaders,omitempty"` AllowCredentials bool `json:"allowCredentials,omitempty"` ExposedHeaders []string `json:"exposedHeaders,omitempty"` MaxAge int `json:"maxAge,omitempty"` }
Spec describes of CORSAdaptor.
Click to show internal directories.
Click to hide internal directories.