Documentation
¶
Overview ¶
Package components contains additional components which can be mounted in a fire application.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssetServer ¶
type AssetServer struct {
// contains filtered or unexported fields
}
The AssetServer component server an asset directory on a specified path and may optionally server the index file for not found paths which is needed to run single page applications like Ember.
func DefaultAssetServer ¶
func DefaultAssetServer(directory string) *AssetServer
DefaultAssetServer will create and return an AssetServer that is mounted on the root of the application with enabled SPA mode.
func NewAssetServer ¶
func NewAssetServer(path, directory string, spaMode bool) *AssetServer
NewAssetServer creates and returns a new AssetServer.
func (*AssetServer) Describe ¶
func (s *AssetServer) Describe() fire.ComponentInfo
Describe implements the fire.Component interface.
func (*AssetServer) Register ¶
func (s *AssetServer) Register(router *echo.Echo)
Register implements the fire.RoutableComponent interface.
type Protector ¶
type Protector struct {
// RequestBodyLimit defines the maximum size of a request body in the form
// of 4K, 2M, 1G or 1P.
RequestBodyLimit string
// AllowMethodOverriding will allow the usage of the X-HTTP-Method-Override
// header to set a request method when using the POST method.
AllowMethodOverriding bool
// AllowedCORSOrigins specifies the allowed origins when CORS.
AllowedCORSOrigins []string
// AllowedCORSHeaders specifies the allowed headers when CORS.
AllowedCORSHeaders []string
// AllowedCORSMethods specifies the allowed methods when CORS.
AllowedCORSMethods []string
}
A Protector is a component that can be mounted in an application to enforce common security concerns.
func DefaultProtector ¶
func DefaultProtector() *Protector
DefaultProtector returns a protector that is tailored to be used for JSON APIs.
func (*Protector) Describe ¶
func (p *Protector) Describe() fire.ComponentInfo
Describe implements the fire.Component interface.