Documentation
¶
Index ¶
- Variables
- func SetValidationFunction(name string, fx ValidationFunc)
- func ValidateWithRedisPrefix(req *http.Request, rw *goftlmux.MidBuffer, hdlr *CORSType) bool
- type CORSType
- func (hdlr *CORSType) InitializeWithConfigData(next http.Handler, gCfg *cfg.ServerGlobalConfigType, serverName string, ...) (err error)
- func (hdlr *CORSType) PreValidate(gCfg *cfg.ServerGlobalConfigType, cfgData map[string]interface{}, ...) (err error)
- func (hdlr *CORSType) RedisGetValidOrigin(key string) (val string, err error)
- func (hdlr *CORSType) ServeHTTP(www http.ResponseWriter, req *http.Request)
- type RedisCORSType
- type ValidationFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ValidationMap map[string]ValidationFunc
Functions ¶
func SetValidationFunction ¶ added in v0.7.5
func SetValidationFunction(name string, fx ValidationFunc)
Types ¶
type CORSType ¶
type CORSType struct {
Next http.Handler
Paths []string `gfType:"string,filepath" gfRequired:"true"`
CookiePolyfilPaths []string `gfType:"string,filepath" gfDefault:"/api/cors-session-cookie-polyfil.js"`
AllowedOrigins []string `gfDefault:""` // Array of RE to match
AllowedMethods []string `gfDefault:""`
ExposedHeaders []string `gfDefault:""`
AllowCredentials bool `gfDefault:"false"`
AllowOriginFunc string `gfDefault:""`
AllowedHeaders []string `gfDefault:""`
MaxAge int `gfDefault:"86400"`
GetOriginURI string `gfDefault:"/api/cors/GetOrigin"`
OptionPassthrough bool `gfDefault:"false"`
LineNo int `gfDefault:"1"`
Debug01 bool `gfDefault:"true"`
RedisPrefix string `gfDefault:""`
// contains filtered or unexported fields
}
allowOriginFunc func(origin string) bool // Optional origin validation function
func (*CORSType) InitializeWithConfigData ¶
func (*CORSType) PreValidate ¶
func (*CORSType) RedisGetValidOrigin ¶
type RedisCORSType ¶ added in v0.7.6
Click to show internal directories.
Click to hide internal directories.