Documentation
¶
Index ¶
- type CorsHandler
- func (cors *CorsHandler) AllowCredentials(creds bool)
- func (cors *CorsHandler) AllowHeader(header string)
- func (cors *CorsHandler) AllowMethod(method string)
- func (cors *CorsHandler) AllowOrigin(origin string)
- func (cors *CorsHandler) AllowedHeaders() string
- func (cors *CorsHandler) AllowedMethods() string
- func (cors *CorsHandler) ExposeHeader(header string)
- func (cors *CorsHandler) ExposedHeaders() string
- func (cors *CorsHandler) IsHeaderAllowed(header string) bool
- func (cors *CorsHandler) IsMethodAllowed(method string) bool
- func (cors *CorsHandler) IsOriginAllowed(origin string) bool
- func (cors *CorsHandler) RemoveExposedHeader(header string)
- func (cors *CorsHandler) RemoveHeader(header string)
- func (cors *CorsHandler) RemoveMethod(method string)
- func (cors *CorsHandler) RemoveOrigin(origin string)
- func (cors *CorsHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (cors *CorsHandler) SetMaxAge(age float64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CorsHandler ¶
type CorsHandler struct { ALLOWED_METHODS []string ALLOWED_ORIGINS []string ALLOWED_HEADERS []string EXPOSED_HEADERS []string ALLOW_CREDENTIALS string MAX_AGE float64 // contains filtered or unexported fields }
func New ¶
func New(handler http.Handler) *CorsHandler
func (*CorsHandler) AllowCredentials ¶
func (cors *CorsHandler) AllowCredentials(creds bool)
func (*CorsHandler) AllowHeader ¶
func (cors *CorsHandler) AllowHeader(header string)
func (*CorsHandler) AllowMethod ¶
func (cors *CorsHandler) AllowMethod(method string)
func (*CorsHandler) AllowOrigin ¶
func (cors *CorsHandler) AllowOrigin(origin string)
func (*CorsHandler) AllowedHeaders ¶
func (cors *CorsHandler) AllowedHeaders() string
func (*CorsHandler) AllowedMethods ¶
func (cors *CorsHandler) AllowedMethods() string
func (*CorsHandler) ExposeHeader ¶
func (cors *CorsHandler) ExposeHeader(header string)
func (*CorsHandler) ExposedHeaders ¶
func (cors *CorsHandler) ExposedHeaders() string
func (*CorsHandler) IsHeaderAllowed ¶
func (cors *CorsHandler) IsHeaderAllowed(header string) bool
func (*CorsHandler) IsMethodAllowed ¶
func (cors *CorsHandler) IsMethodAllowed(method string) bool
func (*CorsHandler) IsOriginAllowed ¶
func (cors *CorsHandler) IsOriginAllowed(origin string) bool
func (*CorsHandler) RemoveExposedHeader ¶
func (cors *CorsHandler) RemoveExposedHeader(header string)
func (*CorsHandler) RemoveHeader ¶
func (cors *CorsHandler) RemoveHeader(header string)
func (*CorsHandler) RemoveMethod ¶
func (cors *CorsHandler) RemoveMethod(method string)
func (*CorsHandler) RemoveOrigin ¶
func (cors *CorsHandler) RemoveOrigin(origin string)
func (*CorsHandler) ServeHTTP ¶
func (cors *CorsHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)
func (*CorsHandler) SetMaxAge ¶
func (cors *CorsHandler) SetMaxAge(age float64)
Click to show internal directories.
Click to hide internal directories.