Documentation ¶
Index ¶
- Variables
- type CORS
- func (*CORS) Descriptor() ([]byte, []int)deprecated
- func (x *CORS) GetAllowCredentials() bool
- func (x *CORS) GetAllowedHeaders() []string
- func (x *CORS) GetAllowedMethods() []string
- func (x *CORS) GetAllowedOrigins() []string
- func (x *CORS) GetDebug() bool
- func (x *CORS) GetEnable() bool
- func (x *CORS) GetExposedHeaders() []string
- func (x *CORS) GetMaxAge() *durationpb.Duration
- func (x *CORS) GetOptionsPassthrough() bool
- func (x *CORS) GetUseConditional() bool
- func (*CORS) ProtoMessage()
- func (x *CORS) ProtoReflect() protoreflect.Message
- func (x *CORS) Reset()
- func (x *CORS) String() string
- type CompletedConfig
- type Config
Constants ¶
This section is empty.
Variables ¶
View Source
var File_core_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type CORS ¶ added in v0.0.40
type CORS struct { Enable bool `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"` // returns Access-Control-Allow-Origin: * if false UseConditional bool `protobuf:"varint,2,opt,name=use_conditional,json=useConditional,proto3" json:"use_conditional,omitempty"` // allowed_origins is a list of origins a cross-domain request can be executed from. // If the special "*" value is present in the list, all origins will be allowed. // An origin may contain a wildcard (*) to replace 0 or more characters // (i.e.: http://*.domain.com). Usage of wildcards implies a small performance penalty. // Only one wildcard can be used per origin. // Default value is ["*"] // return Access-Control-Allow-Origin AllowedOrigins []string `protobuf:"bytes,3,rep,name=allowed_origins,json=allowedOrigins,proto3" json:"allowed_origins,omitempty"` // allowed_methods is a list of methods the client is allowed to use with // cross-domain requests. Default value is simple methods (HEAD, GET and POST). AllowedMethods []string `protobuf:"bytes,4,rep,name=allowed_methods,json=allowedMethods,proto3" json:"allowed_methods,omitempty"` // allowed_headers is list of non simple headers the client is allowed to use with // cross-domain requests. // If the special "*" value is present in the list, all headers will be allowed. // Default value is [] but "Origin" is always appended to the list. AllowedHeaders []string `protobuf:"bytes,5,rep,name=allowed_headers,json=allowedHeaders,proto3" json:"allowed_headers,omitempty"` // exposed_headers indicates which headers are safe to expose to the API of a CORS // API specification // return Access-Control-Expose-Headers ExposedHeaders []string `protobuf:"bytes,6,rep,name=exposed_headers,json=exposedHeaders,proto3" json:"exposed_headers,omitempty"` // allow_credentials indicates whether the request can include user credentials like // cookies, HTTP authentication or client side SSL certificates. // return Access-Control-Allow-Credentials AllowCredentials bool `protobuf:"varint,7,opt,name=allow_credentials,json=allowCredentials,proto3" json:"allow_credentials,omitempty"` // options_passthrough instructs preflight to let other potential next handlers to // process the OPTIONS method. Turn this on if your application handles OPTIONS. OptionsPassthrough bool `protobuf:"varint,8,opt,name=options_passthrough,json=optionsPassthrough,proto3" json:"options_passthrough,omitempty"` // max_age indicates how long the results of a preflight request // can be cached MaxAge *durationpb.Duration `protobuf:"bytes,9,opt,name=max_age,json=maxAge,proto3" json:"max_age,omitempty"` // debug flag adds additional output to debug server side CORS issues Debug bool `protobuf:"varint,10,opt,name=debug,proto3" json:"debug,omitempty"` // contains filtered or unexported fields }
func (*CORS) Descriptor
deprecated
added in
v0.0.40
func (*CORS) GetAllowCredentials ¶ added in v0.0.40
func (*CORS) GetAllowedHeaders ¶ added in v0.0.40
func (*CORS) GetAllowedMethods ¶ added in v0.0.40
func (*CORS) GetAllowedOrigins ¶ added in v0.0.40
func (*CORS) GetExposedHeaders ¶ added in v0.0.40
func (*CORS) GetMaxAge ¶ added in v0.0.40
func (x *CORS) GetMaxAge() *durationpb.Duration
func (*CORS) GetOptionsPassthrough ¶ added in v0.0.40
func (*CORS) GetUseConditional ¶ added in v0.0.40
func (*CORS) ProtoMessage ¶ added in v0.0.40
func (*CORS) ProtoMessage()
func (*CORS) ProtoReflect ¶ added in v0.0.40
func (x *CORS) ProtoReflect() protoreflect.Message
type CompletedConfig ¶
type CompletedConfig struct {
// contains filtered or unexported fields
}
func (CompletedConfig) NewGinHandler ¶ added in v0.0.14
func (c CompletedConfig) NewGinHandler() gin.HandlerFunc
func (CompletedConfig) NewWrapper ¶ added in v0.0.14
type Config ¶
type Config struct { GetViper func() *viper.Viper // If set, overrides params below Proto CORS Validator *validator.Validate }
func NewViperConfig ¶ added in v0.0.40
NewViperConfig returns a Config struct with the global viper instance key representing a sub tree of this instance. NewViperConfig is case-insensitive for a key.
func (*Config) Complete ¶
func (c *Config) Complete() CompletedConfig
Complete fills in any fields not set that are required to have valid data and can be derived from other fields. If you're going to `ApplyOptions`, do that first. It's mutating the receiver.
Click to show internal directories.
Click to hide internal directories.