Versions in this module Expand all Collapse all v0 v0.12.1 Jul 28, 2018 Changes in this version type Domain + Key string v0.12.0 Jul 7, 2018 Changes in this version + const SlashString + const Version + var ErrCORSContentTypeNotAllowed = errors.New("cors: content-type not allowed") + var ErrCORSHeaderNotAllowed = errors.New("cors: header not allowed") + var ErrCORSMethodNotAllowed = errors.New("cors: method not allowed") + var ErrCORSOriginIsInvalid = errors.New("cors: invalid origin") + var ErrNoDomainRoutesConfigFound = errors.New("router: no domain routes config found") + var ErrRouteConstraintFailed = errors.New("router: route constraints failed") + var HTTPMethodActionMap = map[string]string + func CleanPath(p string) string + func IsDefaultAction(action string) bool + type CORS struct + AllowCredentials bool + AllowHeaders []string + AllowMethods []string + AllowOrigins []string + ExposeHeaders []string + MaxAge string + func (c *CORS) AddAllowHeaders(hdrs []string) *CORS + func (c *CORS) AddAllowMethods(methods []string) *CORS + func (c *CORS) AddExposeHeaders(hdrs []string) *CORS + func (c *CORS) AddOrigins(origins []string) *CORS + func (c *CORS) IsHeadersAllowed(hdrs string) bool + func (c *CORS) IsMethodAllowed(method string) bool + func (c *CORS) IsOriginAllowed(origin string) bool + func (c *CORS) SetAllowCredentials(b bool) *CORS + func (c *CORS) SetMaxAge(age string) *CORS + func (c CORS) String() string + type Domain struct + AntiCSRFEnabled bool + AutoOptions bool + CORS *CORS + CORSEnabled bool + DefaultAuth string + Host string + IsSubDomain bool + MethodNotAllowed bool + Name string + Port string + RedirectTrailingSlash bool + func (d *Domain) AddRoute(route *Route) error + func (d *Domain) Allowed(requestMethod, path string) (allowed string) + func (d *Domain) Lookup(req *http.Request) (*Route, ahttp.PathParams, bool) + func (d *Domain) LookupByName(name string) *Route + func (d *Domain) RouteURL(routeName string, args ...interface{}) string + func (d *Domain) RouteURLNamedArgs(routeName string, args map[string]interface{}) string + type Route struct + Action string + Auth string + CORS *CORS + Constraints map[string]string + Dir string + File string + IsAntiCSRFCheck bool + IsStatic bool + ListDir bool + MaxBodySize int64 + Method string + Name string + ParentName string + Path string + Target string + func (r *Route) HasAccess(subject *security.Subject) (bool, []*authz.Reason) + func (r *Route) IsDir() bool + func (r *Route) IsFile() bool + func (r *Route) String() string + type Router struct + Domains map[string]*Domain + func New(configPath string, appCfg *config.Config) *Router + func NewWithApp(app interface{}, configPath string) (*Router, error) + func (r *Router) DomainAddresses() []string + func (r *Router) FindDomain(req *ahttp.Request) *Domain + func (r *Router) Load() (err error) + func (r *Router) Lookup(host string) *Domain + func (r *Router) RegisteredActions() map[string]map[string]uint8 + func (r *Router) RegisteredWSActions() map[string]map[string]uint8 + func (r *Router) RootDomain() *Domain