Documentation ¶
Index ¶
- type Config
- func (config *Config) AllowAllOrigins() *Config
- func (config *Config) AllowCredentials(allow bool) *Config
- func (config *Config) AllowHeaders(headers ...string) *Config
- func (config *Config) AllowMethods(methods ...string) *Config
- func (config *Config) AllowOrigins(origins ...string) *Config
- func (config *Config) Apply(app *govalin.App)
- func (config *Config) Name() string
- func (config *Config) OnInit(_ *govalin.Config)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func (*Config) AllowAllOrigins ¶ added in v0.2.0
AllowAllOrigins will explicitly set allowed origins to "*", allowing all origins.
For more details see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin
func (*Config) AllowCredentials ¶ added in v0.2.0
AllowCredentials will allow for the user to send credentials using cross origin requests
For more details see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials
func (*Config) AllowHeaders ¶ added in v0.2.0
AllowHeaders sets the allowed headers for CORS in addition to the safelisted headers found in https://developer.mozilla.org/en-US/docs/Glossary/CORS-safelisted_request_header. Defaults to "*"
For more details see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers
func (*Config) AllowMethods ¶ added in v0.2.0
AllowMethods sets the allowed methods for CORS. Defaults to GET, POST, PUT, DELETE, OPTIONS.
func (*Config) AllowOrigins ¶ added in v0.2.0
AllowOrigins sets the allowed origins for cross origin requests
For more details see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin