Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Root = &RootExpr{
APIOrigins: map[string]*OriginExpr{},
ServiceOrigins: map[string]*OriginExpr{},
}
Root is the design root expression.
Functions ¶
func PreflightPaths ¶
func PreflightPaths(svc string) []string
PreflightPaths returns the paths that should handle OPTIONS requests for the given service.
Types ¶
type OriginExpr ¶
type OriginExpr struct {
// Origin is the origin string.
Origin string
// Methods is the list of authorized HTTP methods.
Methods []string
// Exposed is the list of headers exposed to clients.
Exposed []string
// Headers is the list of authorized headers, "*" authorizes all.
Headers []string
// MaxAge is the duration to cache a preflight request response.
MaxAge uint
// Credentials sets Access-Control-Allow-Credentials header in the
// response.
Credentials bool
// Regexp tells whether the Origin string is a regular expression.
Regexp bool
// Parent expression, ServiceExpr or APIExpr.
Parent eval.Expression
}
OriginExpr describes a CORS policy.
func Origins ¶
func Origins(svc string) []*OriginExpr
Origins returns the origin expressions (sorted alphabetically by origin string) for the given service.
type RootExpr ¶
type RootExpr struct {
// APIOrigins lists all the CORS definitions indexed by origin string
// at the API level.
APIOrigins map[string]*OriginExpr
// ServiceOrigins lists all the CORS definitions indexed by origin string
// at the service level.
ServiceOrigins map[string]*OriginExpr
}
RootExpr keeps track of the CORS origins defined in the design.
func (*RootExpr) DependsOn ¶
func (r *RootExpr) DependsOn() []eval.Root
DependsOn tells the eval engine to run the goa DSL first.
func (*RootExpr) EvalName ¶
func (r *RootExpr) EvalName() string
EvalName returns the name used in error messages.
Click to show internal directories.
Click to hide internal directories.