Documentation ¶
Index ¶
- Constants
- Variables
- func Check(v *Config, workers map[eosc.RequireId]eosc.IWorker) error
- func Create(id, name string, conf *Config, workers map[eosc.RequireId]eosc.IWorker) (eosc.IWorker, error)
- func NewFactory() eosc.IExtenderDriverFactory
- func Register(register eosc.IExtenderDriverRegister)
- type Checker
- type Config
- type CorsFilter
- func (c *CorsFilter) CheckSkill(skill string) bool
- func (c *CorsFilter) Destroy()
- func (c *CorsFilter) DoFilter(ctx eocontext.EoContext, next eocontext.IChain) (err error)
- func (c *CorsFilter) DoHttpFilter(ctx http_service.IHttpContext, next eocontext.IChain) (err error)
- func (c *CorsFilter) Reset(conf interface{}, workers map[eosc.RequireId]eosc.IWorker) error
- func (c *CorsFilter) Start() error
- func (c *CorsFilter) Stop() error
- func (c *CorsFilter) WriteHeader(ctx http_service.IHttpContext)
- type Driver
- type ICheck
- type IHeader
Constants ¶
View Source
const (
Name = "cors"
)
Variables ¶
View Source
var (
ErrorCredentialTypeError = errors.New("the other options cannot be `*` when `allowCredentials` is true")
)
Functions ¶
func NewFactory ¶
func NewFactory() eosc.IExtenderDriverFactory
func Register ¶
func Register(register eosc.IExtenderDriverRegister)
Types ¶
type Config ¶
type Config struct { AllowOrigins string `json:"allow_origins" label:"允许跨域访问的Origin" default:"*"` AllowMethods string `json:"allow_methods" label:"允许通过的请求方式" default:"*" description:"多种请求方式用英文逗号隔开"` AllowCredentials bool `json:"allow_credentials" label:"请求中是否携带cookie"` AllowHeaders string `` /* 162-byte string literal not displayed */ ExposeHeaders string `` /* 163-byte string literal not displayed */ MaxAge int32 `` /* 134-byte string literal not displayed */ }
type CorsFilter ¶
type CorsFilter struct { drivers.WorkerBase // contains filtered or unexported fields }
func (*CorsFilter) CheckSkill ¶
func (c *CorsFilter) CheckSkill(skill string) bool
func (*CorsFilter) Destroy ¶
func (c *CorsFilter) Destroy()
func (*CorsFilter) DoHttpFilter ¶ added in v0.8.0
func (c *CorsFilter) DoHttpFilter(ctx http_service.IHttpContext, next eocontext.IChain) (err error)
func (*CorsFilter) Start ¶
func (c *CorsFilter) Start() error
func (*CorsFilter) Stop ¶
func (c *CorsFilter) Stop() error
func (*CorsFilter) WriteHeader ¶
func (c *CorsFilter) WriteHeader(ctx http_service.IHttpContext)
WriteHeader CORS响应告诉本服务的规则
Click to show internal directories.
Click to hide internal directories.